No module named 'virtualenvwrapper'

900    Asked by FelicityDavies in Python , Asked on May 14, 2021
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' ( 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?

Answered by Anil Mer

Here is the best solution for /usr/bin/python: no module named virtualenvwrapper

Installing:

 ubuntu@ip-XXX-XX-XX-XX:~$ mkvirtualenv -p /usr/bin/python3.4 env1

 Running virtualenv with interpreter /usr/bin/python3.4

 Using base prefix '/usr'

 New python executable in env1/bin/python3.4

 Also creating executable in env1/bin/python

 Installing setuptools, pip...done.

Verifying and Running:

 (env1)ubuntu@ip-XXX-XX-XX-XX:~$ deactivate

 ubuntu@ip-XXX-XX-XX-XX:~$ ls

 ubuntu@ip-XXX-XX-XX-XX:~$ ls -a

 . .. .bash_history .bash_logout .bashrc .cache .pip .profile .ssh .virtualenvs

 ubuntu@ip-XXX-XX-XX-XX:~$ workon

 env1

 ubuntu@ip-XXX-XX-XX-XX:~$ workon env1

 (env1)ubuntu@ip-XXX-XX-XX-XX:~$ which python

 /home/ubuntu/.virtualenvs/env1/bin/python

 (env1)ubuntu@ip-XXX-XX-XX-XX:~$ python -V

 Python 3.4.0



Your Answer

Interviews

Parent Categories