PYTHONHOME bash var breaks virtualenv

Bug #290844 reported by David Gardner
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

Revision history for this message
David Gardner (dgardner-creatureshop) wrote :
Revision history for this message
Ian Bicking (ianb) wrote :

I've added a warning about $PYTHONHOME

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

Other bug subscribers

Bug attachments

Remote bug watches

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