[Python-Dev] Remove site-packages?!? [was: [Distutils] PEP 376 - from pythonpkgmgr's point of view]

David Lyon david.lyon at preisshare.net
Wed Jul 22 16:54:16 CEST 2009


On Wed, 22 Jul 2009 10:26:59 -0400, Tres Seaver <tseaver at palladion.com>
wrote:
> You were complaining that setuptools /
> distutils wants to put files in an "OS-controlled directory":  

I complain about many things - so what.

> I was
> asking how Python was supposed to know the difference between
> /usr/lib/python2.x/site-packages (presumably "OS-controlled") and
> /opt/Python2.x/lib/python2.x/site-packages (definitely not
> "OS-controlled").

Well, at an interpreter level it doesn't, and I don't expect it
to.

> The solution is to avoid doing distutils / setuptools operations as
> root, *ever*, and instead use either an alternate install location (such
> as /opt/Python2.x) 

Have you tried this ?

When I try to run it without su privelages setuptools crashes... (ubuntu
8.10)

------------------------------------------------------------------------------------------------
Running installer ... /usr/bin/easy_install "/media/Elements/Pythn
Packages/html5lib-0.10.zip"
ERRORS: Traceback (most recent call last):
  File "/usr/bin/easy_install", line 5, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/apport_python_hook.py", line 78,
in apport_excepthook
    report_file = open(pr_filename, 'wt')
IOError: [Errno 13] Permission denied:
'/var/crash/_usr_bin_easy_install.1000.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/easy_install", line 5, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
------------------------------------------------------------------------------------------------

I can only get it to work with sudo.

> That is precisely how I think of virtualenv: it sits on top of distutils
> / setuptools, and makes it sane to do Python development without
> compromising the core system.

For me I prefer using a tool with a GUI interface.

Take care

David



More information about the Python-Dev mailing list