Install homebrew
Follow homebrew installation instruction from its official site. Basically just type in your terminal
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
Install python
It's easy with homebrew. Just type
brew install python
Set PATH
Set your Python Path. Write on your .bash_profile
export PATH=/usr/local/share/python:$PATH
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
Install virtualenv
I know, probably you don't want to do 'cause you want just ONE python. I am with you, but it seems quite hard to do on Mac OS X. So, be patient!
pip install virtualenv
Create a virtualenv
I put my virtualenv in the same directory of my project. Probably it's redundant, but it's specific for this project.
cd fooproject
virtualenv py27 --distribute
A new directory called py27 will be created. It will contain
all python libraries. Now, let's activate our new virtualenv
virtualenv py27 --distribute
source py27/bin/activate
Your shell will become something like this:
(py27)darkstar: fooproject username$
Install PySide and PySide Tools
For some unclear reasons, pip can't install pyside: it can't find
brew install pyside pyside-tools
Install GFortran
NumPy require GFortran. So add it with brew
brew install gfortran
Install matplotlib
Always in virtualenv, I installed matplotlib and numpy
pip install numpy matplotlib
Conclusion
Program and install your packages always from your virtualenv. When you're tired of it, just type
deactivate
And you'll exit.
Good luck: I had many problems with this stuff!
No comments:
Post a Comment