These commands are generated by the script virtualenvwrapper.sh
. You have to source that file in order to get the commands.
Try this:
find / -name "virtualenvwrapper.sh" 2>/dev/null
It should find and return the filepath. On my system it is:
/usr/share/virtualenvwrapper/virtualenvwrapper.sh
So you can do:
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
Now you should have the commands. Probably you'd like to have these commands without sourcing virtualenvwrapper.sh
everytime you boot your system.
Add that line to your .bashrc
(or alternatively in .bash_profile
or .profile
), along with two other lines
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Projects
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
After that create the directory Projects
(you can call it whatever you want and place it whereever you want) manually:
mkdir $HOME/Projects
After the next start you should have all the commands and the new environment variables. When you do:
mkproject foo
new directory foo will be created:
.virtualenvs/foo
and:
Projects/foo
The first one is your virtual environment, the second one is where your projects lives. With workon foo
you can activate it, and with cdvirtualenv
and cdproject
you can switch between them.
EDIT:
After rereading your question, I think the problem might be eventually with the way how you created the virtual environments.
The commands lsvirtualenv
and workon
are provided by virtualenvwrapper
. If you create your virtual environments with the comand mkvirtualenv
(also provided by virtualenvwrapper
) then lsvirtualenv
and workon
will list them.
But if you create them like this:
virtualenv foo
virtualenvwrapper
won't be aware of your virtual environments.