Markdown created in Html-to-Markdown converter
If you need to rebuild your virtualenv following a system image upgrade
The instructions below will contain instructions for people who use plain virtualenv
and virtualenvwrapper
; make sure that you use the appropriate ones for the kind of virtualenv you're using. Use a Bash console to enter the commands.
If you've already got a requirements.txt
file, you can skip this bit, although you may want to just do the bit where we double-check what version of Python we're using.
- Activate your virtualenv, using
source /home/myusername/path/to/virtualenv/bin/activate
or, if you're using virtualenvwrapperworkon my-virtualenv-name
- Save the list of packages to a requirements file
pip freeze > /tmp/requirements.txt
- Double-check which version of python is in your virtualenv
python --version
- Deactivate the virtualenv
deactivate
Using plain virtualenvs:
rm -rf /home/myusername/path/to/virtualenv
or, if using virtualenvwrapper:
rmvirtualenv my-virtualenv-name
Using the appropriate Python version in place of X.Y
:
virtualenv --python\=pythonX.Y /home/myusername/path/to/virtualenv
or, with virtualenvwrappper
mkvirtualenv --python\=pythonX.Y my-virtualenv-name
pip install -r /tmp/requirements.txt \# or path to your existing requirements.txt
On the Web tab, use the "Reload" button to restart your website code using the new virtualenvs -- don't forget to do this for all of your websites if you have several.
You will also need to restart any always-on tasks that use them -- just disable them, then enable them again. Scheduled tasks that use virtualenvs will pick them up the next time they run.