Virtualenv: library isolated for Python

virtualenv not working under opensuse

Reported by Malte Marquarding on 2008-07-15
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Virtualenv
In Progress
Undecided
Unassigned
python-virtualenv (Fedora)
Fix Released
Unknown

Bug Description

opensuse 10.1 or greater, sets up a system 'distutils.cfg' with default install location being '/usr/local'.

The attached patch fixes this.

Stephen Pascoe (stephen-pascoe) wrote :

The patch almost completely fixes the problem for me. A reference to global site-packages doesn't get added to sys.path.

Delving into SuSE's python installation I'm not surprised ... site.py has been patched to add '/usr/local' to the list of prefixes. I hope to report this to SuSE and will reference it here when done.

Two invocations of python follow. One via virtualenv, the other not. Note the former doesn't include /usr/local/lib64/python2.5/site-packages.

.....

(myenv2)spascoe@bond:~/host/bond/expt> python
Python 2.5.1 (r251:54863, Sep 21 2007, 22:46:31)
[GCC 4.2.1 (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys, pprint
>>> pprint.pprint(sys.path)
['',
 '/disks/bond1/spascoe/expt/myenv2/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg',
 '/disks/bond1/spascoe/expt',
 '/disks/bond1/spascoe/expt/myenv2/lib/python25.zip',
 '/disks/bond1/spascoe/expt/myenv2/lib64/python2.5',
 '/disks/bond1/spascoe/expt/myenv2/lib64/python2.5/plat-linux2',
 '/disks/bond1/spascoe/expt/myenv2/lib64/python2.5/lib-tk',
 '/disks/bond1/spascoe/expt/myenv2/lib64/python2.5/lib-dynload',
 '/usr/lib/python2.5',
 '/usr/lib64/python2.5',
 '/usr/lib64/python2.5/lib-tk',
 '/disks/bond1/spascoe/expt/myenv2/lib/python2.5/site-packages']
>>>
(myenv2)spascoe@bond:~/host/bond/expt> /usr/bin/python
Python 2.5.1 (r251:54863, Sep 21 2007, 22:46:31)
[GCC 4.2.1 (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys, pprint
>>> pprint.pprint(sys.path)
['',

 ... eggs-snipped...

 '/usr/local/lib64/python2.5/site-packages/setuptools-0.6c9-py2.5.egg',
 '/disks/bond1/spascoe/expt',
 '/usr/lib/python25.zip',
 '/usr/lib64/python2.5',
 '/usr/lib64/python2.5/plat-linux2',
 '/usr/lib64/python2.5/lib-tk',
 '/usr/lib64/python2.5/lib-dynload',
 '/usr/lib64/python2.5/site-packages',
 '/usr/lib64/python2.5/site-packages/Numeric',
 '/usr/lib64/python2.5/site-packages/gtk-2.0',
 '/usr/local/lib64/python2.5/site-packages']
>>>

Ian Bicking (ianb) wrote :

Applied in r3602

Changed in virtualenv:
status: New → Fix Committed
ashcrow (stevem-gnulinux) wrote :

Bug reported to Fedora as well ....

https://bugzilla.redhat.com/show_bug.cgi?id=471617

Changed in python-virtualenv:
status: Unknown → In Progress
Ian Bicking (ianb) wrote :

I've had to revert this because setting prefix leads to some weird problems in other cases, and the problems are very hard to track down at that (you can tell it has to do with distutils.cfg because removing this setting from that file fixes it).

The system distutils.cfg shouldn't really be used in this context, so I'll look into why that might be happening.

Ian Bicking (ianb) on 2008-12-17
Changed in virtualenv:
status: Fix Committed → In Progress
Changed in python-virtualenv:
status: In Progress → Fix Committed
Changed in python-virtualenv:
status: Fix Committed → Fix Released
Carl Meyer (carljm) wrote :

Not migrating to new tracker at https://github.com/pypa/virtualenv/issues - appears to have been fixed, no recent updates.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.