Friday, 19 September 2014

Virtualenvwrapper makes it easier to use Python's virtualenv

  1. Install the following packages. I still need to use Python 2. If you want to use Python 3 just remove the 2 below:
    $ sudo pacman -Sy
    $ sudo pacman -S python-virtualenvwrapper python2-virtualenv python2-pip
  2. Introduce virtualenv in your .bashrc:
    $ nano ~/.bashrc
    export WORKON_HOME=$HOME/.virtualenvs
    source /usr/bin/virtualenvwrapper.sh
  3. Create a project e.g. myProject in virtualenv:
    $ mkvirtualenv myProject --python=/usr/bin/python2
    $ pip install sphinx
  4. Other virtualenv commands:
  • $ workon myProject        # activate the virtualenv called myProject
  • $ deactivate              # deactivate the current virtualenv
  • $ rmvirtualenv myProject  # delete the current virtualenv

No comments:

Post a Comment