Sei sulla pagina 1di 3

Installing Python (Numpy, Matplotlib , Scipy)| Mac Lion using terminal

CHECKING 1. In terminal, type in $ which gcc $ which gfortran it should show the location of your file, if not please install 2. in terminal, type in $ python it should change to python platform, can be noticed by ">>> " 3. In python shell, type in >>>import matplotlib >>>import numpy >>>import scipy if it show "no module", then you must install the missing module, else you have everything and it's DONE!!! :) INSTALLING Installing gcc and gfortran 1. download gcc and gfortran here "http://r.research.att.com/tools/". Download and run both file gcc-42-5666.3-darwin11.pkg , gfortranlion-5666-3.pkg. 2. Check gcc and gfortran Installing python 1. go to http://python.org/ choose the version that match your computer 2. After finish download, run the program. 3. Open terminal to continue the process 4. in terminal, type in $ python ez_setup.py if error=missing ez-setup.py, continue else check python shell 5. Download ez_setup from https://pypi.python.org/pypi/setuptools [download by save linkas at ez_setup.py link] 6. After finish download, move your ez_setup.py to the folder of your python [should be in /Library/Frameworks/Python.framework/Versions/2.7/Resources], then

repeat step 4. Installing Numpy 1. Download numpy-1.5.1.tar.gz, a numpy module, at https://pypi.python.org/pypi/numpy/1.5.1. You can save it anywhere. 2. in terminal, access the folder that contain numpy, type in $ cd /directory/directory/numpy 3. when you are in the folder, you have to extract the file, type in $ tar xvzf numpy-1.5.1.tar.gz 4. to open the file, type in $ cd numpy-1.5.1 5. to install numpy, type in $ python setup.py install 6. Check numpy module Installing Matplotlip 1. In terminal, type in $ easy_install matplotlib 2. Check matplotlib module Installing Scipy 1. Download scipy-0.11.0.tar.gz, scipy module, at https://pypi.python.org/pypi/scipy. You can save it anywhere 2. In terminal, access the folder that contain scipy, type in $ cd /directory/directory/scipy 3. when you are in the folder, to extract the file, type in $ tar xvzf scipy-0.11.0.tar.gz 4. to open the file, type in $ cd scipy-0.11.0 5. to set a suitable gcc and gfortran, type in $ export CC=clang $ export CXX=clang $ export FFLAGS=-ff2c 6. to build the environment, type in $ python setup.py build 7. to install scipy, type in

$ python setup.py install 8. Check scipy module Note: if needed: Installing nose 1. In terminal, type in $ curl -O http://python-nose.googlecode.com/files/nose0.10.1.tar.gz $ tar xvfz nose-0.10.1.tar.gz $ cd nose $ python setup.py install Installing pyamg 1. In terminal, type in $ curl -O http://pyamg.googlecode.com/files/pyamg-1.0.0.tar.gz $ tar xvfz pyamg-1.0.0.tar.gz $ cd pyamg $ python setup.py build $ python setup.py install *Checking can be done in python shell using import command

Potrebbero piacerti anche