mkvirtualenv --no-site-packages command getting "command not found" error
Asked Answered
N

2

14

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.

Nix answered 1/3, 2012 at 17:22 Comment(0)
H
26

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).

Hunt answered 1/3, 2012 at 17:25 Comment(0)
S
4

This can actually vary a little bit depending on how you installed it. If you installed it on Ubuntu with apt, the virtualenvwrapper functions are actually rolled into a bash completion file (figuring that out was fun!).

export WORKON_HOME=$HOME/.virtualenvs 
export PROJECT_HOME=$HOME/Devel
possible_scripts='/usr/local/bin/virtualenvwrapper.sh /etc/bash_completion.d/virtualenvwrapper'
for script in $possible_scripts; do
  [[ -f $script ]] && source $script
done
Souffle answered 26/11, 2012 at 22:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.