Virtualenv: library isolated for Python

PYTHONHOME bash var breaks virtualenv

Reported by David Gardner on 2008-10-29
2
Affects Status Importance Assigned to Milestone
Virtualenv
Fix Released
Undecided
Unassigned

Bug Description

At work we have PYTHONHOME set in our .bashrc files. This caused virtualenv to report an error when doing:
virtualenv dev
New python executable in dev/bin/python
ERROR: The executable dev/bin/python is not functioning
ERROR: It thinks sys.prefix is '/usr' (should be '/users/dgardner/dev')
ERROR: virtualenv is not compatible with this system or executable

-------
As a workaround I added the following to my activate script:
_OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
unset PYTHONHOME

and in the deactivate() function:
    if [ -n "$_OLD_VIRTUAL_PYTHONHOME" ] ; then
        PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
        export PYTHONHOME
        unset _OLD_VIRTUAL_PYTHONHOME
    fi

Ian Bicking (ianb) wrote :

I've added a warning about $PYTHONHOME

Changed in virtualenv:
status: New → Fix Committed
Ian Bicking (ianb) on 2008-12-17
Changed in virtualenv:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments