0

I am working to set up a django project on ec2 with an Ubuntu 14.4 LTS instance. I want to write my code using python 3 and django. I've been advised that the best way to do this is to use virtualenvwrapper. I tried:

ubuntu:~$ sudo pip3 install virtualenvwrapper   

      Successfully uninstalled six
Successfully installed virtualenvwrapper virtualenv virtualenv-clone stevedore argparse pbr six
Cleaning up...
ubuntu:~$ mkvirtualenv env1
mkvirtualenv: command not found

What am I doing wrong?

edit:

I followed your directions, logged out and logged back in:

/usr/bin/python: 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/python and that PATH is
set properly.

I'm suspecting that this is because I'm installing to python3 which is not the default python interpreter

1 Answer 1

1

From the documentation

Shell Startup File

Add three lines to your shell startup file (.bashrc, .profile, etc.) to set the location where the virtual environments should live, the location of your development project directories, and the location of the script installed with this package:

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh

In particular, sourcing the shell script above will allow you to run all of the virtualenvwrapper commands.

1
  • In that case, you'll need to point VIRTUALENVWRAPPER_PYTHON to wherever python3 is.
    – user554546
    Commented Feb 27, 2015 at 20:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.