Change prompt for virtualenv

August 30, 2017

Context
I use virutalenv and virtualenvwrapper tomanage my development environments. Virtualenvwrapper consolidates all your virtualenvs into a single location, and can link a directory to a virtualenv.
Once in a while, I need to change the name of my repo and/or virtual environment. This means I have to change a bunch of other stuff.

How To

If the project directory is moved/changed/renamed, modify the following:

  1. In the virtualenvs directory (usually ~/.virtualenvs/) there is a ‘.project’ file. Modify the path here to get the workon command to work correctly.

  2. In the ~/.virtualenvs//bin/ directory, open up the ‘activate’ file. Change the ‘VIRTUAL_ENV’ variable to reflect the new path. This will change the bash prompt when the virtualenv is activated.