I am working to set up a Django project on Amazon EC2 with an Ubuntu 14.04 LTS instance. I want to write my code using Python 3. I've been advised that the best way to do this is to use virtualenvwrapper
. I've installed virtualenvwrapper
successfully and put
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3.4
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh
into my .bashrc
file. Now I see:
/usr/bin/python3.4: Error while finding spec for 'virtualenvwrapper.hook_loader' (<class 'ImportErro
r'>: No module named 'virtualenvwrapper')
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3.4 and that PATH is
set properly.
How can I fix this?
virtualenvwrapper
successfully for that version of Python? If you run/usr/bin/python3.4
in the terminal and then try toimport virtualenvwrapper
, what happens? – Junkerpip3 install virtualenvwrapper
to get it installed for the 3.x interpreter. Alternatively, note thatvirtualenvwrapper
installed under 2.x can still create 3.xvirtualenv
s, using the-p
parameter (see e.g. https://mcmap.net/q/20464/-use-different-python-version-with-virtualenv/3001761). – JunkerVIRTUALENVWRAPPER_PYTHON
. – Dread