Tag Archives: virtualenv

Setting up Python, scipy, numpy, on Mac OS X 10.6.8

I want to use an environment that’s a Matlab alternative. A Matlab student license is $500, and I’ve been meaning to become better acquainted with python and scipy, numpy, etc.

Looked around online for a website or a blog post on installing python, scipy, numpy, and matplotlib on Mac OS X 10.6 and finally found a really good source: http://www.thisisthegreenroom.com/2011/installing-python-numpy-scipy-matplotlib-and-ipython-on-lion/

Also looked at this GitHub GIST post: https://gist.github.com/738780 Both of the above helped

To install python, numpy, scipy, matplot lib, etc. (don’t type the quotation marks, just the text inside)

  1. Install Homebrew: http://www.bigfastblog.com/homebrew-intro-to-the-mac-os-x-package-installer
  2. After homebrew has been installed, type, “brew install git” into the terminal
    1. Check that homebrew installed correctly by typing, “brew update” and “brew doctor”
  3. Next install python by typing, “brew install python –framework –universal”
    1. When you edit your path environment, look at this link
    2. Check that python is working,  type “python” in the terminal window and make sure that 2.7.2 is the current version. Type “quit()” to quit.
  4. Install pip with easy_install, “easy_install pip”
    1. easy_install came with homebrew
  5. Setup a virtual environment to install scipy and numpy and matplotlib
    1. This step is for convenience only. Everything from here on out will affect the virtual environment that you create.
    2. type “pip install virtualenv”
    3. type “pip install virtualenvwrapper”
    4. source the virtualenvwrapper script, “source /usr/local/share/python/virtualenvwrapper.sh”
    5. This creates a hidden virtualenv director at ~/.virtualenv
    6. Make first virtualenv, “mkvirtualenv test1”
      1. This virtualenv test1 comes with a complete install of Python 2.7.2 and its own version of Pip. It’s activated by default, so running any pip command will only impact this environment.
      2. This brings up a good question, how the hell do I go exit and re-enter a virtualenv?
      3. Hopefully this holds the answers: http://mathematism.com/2009/07/30/presentation-pip-and-virtualenv/
      4. The above link is great! Use virtualenv to its fullest!
Tagged , , , , ,