Wednesday, September 10, 2014

Upgrading Portable Python and virtualenv

Steps to upgrade your virtualenvs when you upgrade portable python (and perhaps any other python).

  1. Add this portable python to your path variable. I am using msys to give me a linux like environment so I do a:
PYTHON_HOME="/PortableApps/PortablePython2.7.6.1/App"

export PATH="$PYTHON_HOME:$PYTHON_HOME/Scripts:$PATH"
  1. I like pip in the environment so get pip:
    • easy_install pip
  2. Get virtualenv for this portable python:
    • pip install virtualenv
  3. Now redo the virtual env with this virtualenv in the new python. Note "--system-site-packages" is optional and based on what you used previously to build this environment.
    • virtualenv --system-site-packages <path to existing virtual environment>