Here are the basic steps I had to go through to setup a usable virtual environment for python.
- Install enthought python
- Configure enthought python repositories: enthought defaults to using it's own repository which requires a username and password. So...
- open /Library/Frameworks/Python.framework/Version/4.3.0/lib/python2.5/site-packages/.enstallerrc
- edit the [repos] section to list only the following line: 1 = http://pypi.python.org/simple,index
- save the file
- Install virtualenv: run: /Library/Frameworks/Python.framework/Versions/4.3.0/bin/easy_install virtualenv
- Make the virtual environment: run: virtualenv
- Now for some reason mac os x doesn't like python accessing the screen so there is a separate pythonw that you have to run for graphical apps (like scipy). However, virtualenv does not create a pythonw in the /myPython/bin directory. So...
- download install_pythonw.py and pythonw.c from http://github.com/gldnspud/virtualenv-pythonw-osx/tree/master and put them in the same directory
- run: python install_pythonw.py /myPython
- now you should have a pythonw file in /myPython/bin
- at this point you should have a working virtual environment in /myPython but there are a few more useful steps
- install useful packages: /myPython/bin/easy_install ipython pudb winpdb
- fix ipython: open /myPython/bin/ipython and change the first line to read: #!/myPython/bin/pythonw
- create useful aliases, for the fish shell you can do this by typing the following:
- alias python /myPython/python
- alias ipython /myPython/ipython
- alias easy_install /myPython/easy_install
- funcsave python
- funcsave ipython
- funcsave easy_install
- add /myPython/bin to the path (again for fish shell)
- open ~/.config/fish/config.fish
- add the following line: set PATH $PATH /myPython/bin
- and (finally) you're done