mkvirtualenv --no-site-packages command getting "command not found" error

Jeff Severns Guntzel picture Jeff Severns Guntzel · Mar 1, 2012 · Viewed 13.3k times · Source

I have virtualenv and virtualenvwrapper installed, but when trying to setup an application, I enter mkvirtualenv --no-site-packages I get the following error:

-bash: mkvirtualenv: command not found

I am not sure how to troubleshoot this. As a beginner, I'd be grateful for any help.

Answer

wRAR picture wRAR · Mar 1, 2012

You need to enable virtualenvwrapper as described in its docs.

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

After editing it, reload the startup file (e.g., run source ~/.bashrc).