- Install virtualenv and virtualenvwrapper:
sudo pip install virtualenv
sudo pip install virtualenvwrapper
- Create virtual environment folder
mkdir ~/.environments
- Edit your bash profile with vim to point to the newly created virtual environment folder.
echo "export WORKON_HOME=~/.environments" >> ~/.bashrc
source /usr/local/bin/virtualenvwrapper.sh
- Source your bash profile
source ~/.bashrc
- Test run
mkvirtualenv
. Create new environments in python 3 with
mkvirtualenv -p `which python3` city-scrapers
-
Check your virtual environment folder for the newly created virtual environment
-
To activate the environment, type
workon your-env-name
. To exit, typedeactivate
For mac users, your bash profile might be located at
vi ~/.bash_profile
ornano .bash_profile
to use the linux text editor. If that works for you, then you'll also need to runsource ~/.bash_profile
.