0 votes
1 view
in AWS by (19.2k points)

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?

1 Answer

0 votes
by (44.6k points)

Installing:

 [email protected]:~$ 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)[email protected]:~$ deactivate

 [email protected]:~$ ls

 [email protected]:~$ ls -a

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

 [email protected]:~$ workon

 env1

 [email protected]:~$ workon env1

 (env1)[email protected]:~$ which python

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

 (env1)[email protected]:~$  python -V

 Python 3.4.0

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...