Skip to content

EPD and virtualenv

by C. Ross Jam on August 19, 2012

Parking this nugget in case it can help someone else discover it with Google.

EPD, the Enthought Python Distribution, is a nice packaging of a lot of scientific and high performance computing modules. In particular, it takes away the hassle of building from source on persnickety platforms like Mac OS X.

virtualenv is an indispensable Python tool for creating isolated, customizable, and easily disposable Python environments. You can initialize these environments from a specific Python installation allowing experimentation with multiple Python versions in parallel, e.g. EPD and the stock install on your machine.

EPD and virtualenv weren’t working well together for me on my MacBook. Here’s what worked for me:

  • Make sure you have a recent version of virtualenv, 1.7.2 seems good.
  • Use the --system-site-packages argument to make sure you pick up the EPD extensions. You can also hack up postactivate and postdeactivate to fix up PYTHONPATH.
  • Here’s an example of creating a new virtual environment:

mkvirtualenv -p /Library/Frameworks/EPD64.framework/Versions/Current/bin/python --system-site-packages epd64

So far so good. You’ll need the virtualenvwrapper package to use mkvirtualenv.

From → Uncategorized