Think “nice tidy boxes”, but not yet Docker.
Create a virtualenv
Let’s say you wanted to create a
virtualenv for a new project using
This command can be run from anywhere, though I tend to create a directory for the project in my
$HOME/Developer/ directory with the same name as the
Delete a virtualenv
What if you no longer need a particular
virtualenv? Use the
List all current virtualenv
To output a list of existing
virtualenv setups, use the
lsvirtualenv following command, note the
-b option for brevity.
These steps are copy/pasted from this stackoverflow Post so that I can find them quickly.
virtualenvwrapper for repetitive use you need a correctly configured
Python (this example uses
Python 3.x but the process is identical for
Main difference between installer from Python website and brew is that installer puts
Brew on the other hand installs
Setuptools and puts everything to:
And though it may not make any difference to you now – it will later on.
brew installation page or simply run this in your terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Now your system needs to know where to look for freshly installed Python packages. Add this line to
~/.bash_profile if you’re using
Restart your terminal. To make sure you’ve done everything correctly, run
which python3 and in
return you should receive
Install virtualenv & virtualenvwrapper
Now it’s time to install
virtualenvwrapper to be able to use
workon command and
switch between virtual environments. This is done using
Set up virtualenv variables
Define a default path for your virtual environments. For example you can create a hidden directory
~ and call it
mkdir ~/.virtualenvs. Add
virtualenv variables to
Final version of your
.bash_profile) should contain this information to work properly
with installed packages:
Setting PATH for Python 3 installed by brew
Configuration for virtualenv
Restart your terminal
You should be able to use
workon commands including autocompletion.