I have just update my Mac from Snow Leopard to Lion. I then needed to install virtualenv
and virtualenvwrapper
. I used for both easy_install
.
I also added virtualenvwrapper settings to my .bash_profile file as following:
# virtualenvwrapper settings
export WORKON_HOME="~/virtualenvs"
source "/usr/local/bin/virtualenvwrapper.sh"
But when sourcing it I get the following error:
ERROR: Could not create temporary file name. Make sure TMPDIR is set.
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenv has been installed for VIRTUALENVWRAPPER_PYTHON=/Library/Frameworks/Python.framework/Versions/2.7/bin/python and that PATH is set properly.
Thank you all for your help.
Since /Library/Frameworks/Python.framework/Versions/2.7/bin/python
is the path to a separately-installed Python 2.7 (possibly from a python.org installer) rather than the Apple-supplied Python 2.7 (/usr/bin/python2.7
), you need to make sure you are using an easy_install
for that separate Python or change to using the Apple-supplied Python. To do either one, you should ensure that your shell PATH variable is correct. For the first case, you should be able to install an easy_install
by doing the following:
cd /tmp
curl -O http://python-distribute.org/distribute_setup.py
sudo $VIRTUALENVWRAPPER_PYTHON distribute_setup.py
You can fix up your shell PATH to include the framework bin directory. If you are using bash
, one way would be to add this line to ~/.bash_profile
:
export PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
Then open a new Terminal session. You should now find that easy_install
you just installed is the right one:
$ which easy_install
/Library/Frameworks/Python.framework/Versions/2.7/bin/easy_install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With