Skip to content

Instantly share code, notes, and snippets.

@eugene-s
Last active November 6, 2017 21:37
Show Gist options
  • Save eugene-s/53fe967db2733d8cf74768b0a3d92d3c to your computer and use it in GitHub Desktop.
Save eugene-s/53fe967db2733d8cf74768b0a3d92d3c to your computer and use it in GitHub Desktop.

Readme to setup Work On utility

Setting up workon-util

  • installing virtualenv:
sudo apt-get install python-virtualenv
  • creating folder, which will be storing your virtual environments:
mkdir ~/.virtualenvs
  • install comfortable util for working with virtualenvs:
sudo apt-get install virtualenvwrapper
  • Adding few strings to file ~/.profile:
echo -e "\nexport WORKON_HOME=$HOME/.virtualenvs\nsource /etc/bash_completion.d/virtualenvwrapper" >> ~/.profile && source ~/.profile

Commands for working with virtualenvwrapper:

  • create virtualenv
mkvirtualenv {env name}
  • list of virtualenv
lsvirtualenv {env name}
  • remove virtualenv
rmvirtualenv {env name}
  • activate concrete virtualenv
workon {env name}
  • deactivate this
deactivate {env name}

Setting up virtual environment

  • creating virtual environment:
mkvirtualenv example-blog
  • including this venv to project:
PyCharm - File - Settings - Project Interpreter - Add Local - *~/.virtualenvs/example-blog*
  • Press Key F5 and go work!!!

Adding packages to project

pip install -t ~/Projects/example-blog/lib {name of package}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment