Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 2 and Version 3 of RootLessInstall


Ignore:
Timestamp:
01/27/06 00:10:15 (13 years ago)
Author:
dholth@…
Comment:

rootless install (better)

Legend:

Unmodified
Added
Removed
Modified
  • RootLessInstall

    v2 v3  
    2222}}} 
    2323 
    24 2. I really, really like it that Python on OS X automatically looks in my home directory. No more setting PYTHONPATH=$HOME/lib/python2.4/site-packages/ in my ~/.bash_profile , and it works no matter which version of Python I'm using. Besides, PYTHONPATH=... does not tell python to look for eggs or .pth files. So I edit my /usr/lib/python2.4/site.py to do that: 
     24The directive install_data is missing from the PEAK documentation as of 27 Jan. 2005. 
    2525 
    26 {{{ 
    27 #!python 
    28 def addsitepackages(known_paths): 
    29     """Add site-packages (and possibly site-python) to sys.path""" 
    30     prefixes = [os.path.join(sys.prefix, "local"), sys.prefix] 
    31     if sys.exec_prefix != sys.prefix: 
    32         prefixes.append(os.path.join(sys.exec_prefix, "local")) 
    33     for prefix in prefixes: 
    34         if prefix: 
    35             if sys.platform in ('os2emx', 'riscos'): 
    36                 sitedirs = [os.path.join(prefix, "Lib", "site-packages")] 
    37             elif os.sep == '/': 
    38                 sitedirs = [os.path.join(prefix, 
    39                                          "lib", 
    40                                          "python" + sys.version[:3], 
    41                                          "site-packages"), 
    42                             os.path.join(prefix, "lib", "site-python")] 
    43                 try: 
    44                     # sys.getobjects only available in --with-pydebug build 
    45                     sys.getobjects 
    46                     sitedirs.insert(0, os.path.join(sitedirs[0], 'debug')) 
    47                 except AttributeError: 
    48                     pass 
    49             else: 
    50                 sitedirs = [prefix, os.path.join(prefix, "lib", "site-packages")] 
    51             if sys.platform == 'darwin': 
    52                 # for framework builds *only* we add the standard Apple 
    53                 # locations. Currently only per-user, but /Library and 
    54                 # /Network/Library could be added too 
    55                 if 'Python.framework' in prefix: 
    56                     home = os.environ.get('HOME') 
    57                     if home: 
    58                         sitedirs.append( 
    59                             os.path.join(home, 
    60                                          'Library', 
    61                                          'Python', 
    62                                          sys.version[:3], 
    63                                          'site-packages')) 
    64 # ADDED LINES HERE 
    65             home = os.environ.get('HOME') 
    66             if home: 
    67                 if not home in sitedirs: 
    68                     sitedirs.append(os.path.join(home, 
    69                                                 'lib', 
    70                                                 'python' + sys.version[:3], 
    71                                                 'site-packages')) 
    72  
    73 # END OF CHANGE 
    74             for sitedir in sitedirs: 
    75                 if os.path.isdir(sitedir): 
    76                     addsitedir(sitedir, known_paths) 
    77     return None 
    78 }}} 
    79  
    80 3. {{{easy_install foo}}} or {{{python setup.py install}}} should now automaticaly put things in your home directory. No more messing with your system's Python just to try the latest version of turbogears. 
     26== With easy_install == 
     27a  
     28http://peak.telecommunity.com/DevCenter/EasyInstall#custom-installation-locations explains simple ways to get easy_install to install in a variety of locations.