Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k 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.4k 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

Related questions

0 votes
1 answer

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
asked Dec 8, 2020 in SQL by Appu (6.1k points)
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

29.3k questions

30.6k answers

501 comments

104k users

Browse Categories

...