Difference between revisions of "Scipy"

From RedwoodCenter
Jump to navigationJump to search
 
(8 intermediate revisions by the same user not shown)
Line 11: Line 11:
  
 
i heard that the easiest way to install all of these packages is from here: http://code.enthought.com/enthon/
 
i heard that the easiest way to install all of these packages is from here: http://code.enthought.com/enthon/
 +
 +
== Installation (OSX) ==
 +
 +
see below
  
 
== Numpy ==
 
== Numpy ==
Line 26: Line 30:
  
 
(this is the syntax for the cshell. if you are using the bash, you have to put something like 'export PATH=/usr/local/bin:${PATH}' into your ~/.profile file)
 
(this is the syntax for the cshell. if you are using the bash, you have to put something like 'export PATH=/usr/local/bin:${PATH}' into your ~/.profile file)
 +
 +
it is useful to add the directory with your python files, say ~/python to your python path: create the following file and add the line '/Users/your_username/python'
 +
 +
  vi /Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/site-packages/your_username.pth
  
 
=== Numpy ===
 
=== Numpy ===
Line 87: Line 95:
  
 
   setenv DYLD_FALLBACK_LIBRARY_PATH /sw/lib/qt3mac/lib
 
   setenv DYLD_FALLBACK_LIBRARY_PATH /sw/lib/qt3mac/lib
 +
 +
== sip ==
 +
 +
get sip here: http://www.riverbankcomputing.com/Downloads/sip4/sip-4.7.1.tar.gz
 +
 +
  tar xvzf sip-4.7.1.tar.gz
 +
  cd sip-4.7.1
 +
  python configure.py -n
 +
  make
 +
  sudo make install
 +
 +
=== PyQt 3 ===
 +
 +
get PyQt 3 here: http://www.riverbankcomputing.com/Downloads/PyQt3/GPL/PyQt-mac-gpl-3.17.3.tar.gz
 +
 +
  tar xvzf PyQt-mac-gpl-3.17.3
 +
  cd PyQt-mac-gpl-3.17.3
 +
  python configure.py -w -y qt-mt -q /sw/share/qt3mac
 +
 +
make sure that the qtext module is mentioned as one of the modules that will be built!
 +
 +
  make
 +
  sudo make install
  
 
now you have the qt library with python bindings installed. you can change the matplotlib settings to use qt. this way, you won't need x11 any more. just edit ~/.matplotlib/matplotlibrc:
 
now you have the qt library with python bindings installed. you can change the matplotlib settings to use qt. this way, you won't need x11 any more. just edit ~/.matplotlib/matplotlibrc:
Line 117: Line 148:
 
=== Scipy ===
 
=== Scipy ===
  
now you are all set to compile and install scipy. download scipy 0.5.2.1 here: http://prdownloads.sourceforge.net/scipy/scipy-0.5.2.1.tar.gz
+
now you are all set to compile and install scipy. download scipy 0.6.0 here: http://prdownloads.sourceforge.net/scipy/scipy-0.6.0.tar.gz
  
   tar xvzf scipy-0.5.2.1.tar.gz
+
   tar xvzf scipy-0.6.0.tar.gz
   cd scipy-0.5.2.1
+
   cd scipy-0.6.0
 
   python setup.py install
 
   python setup.py install
  
Line 129: Line 160:
  
 
at the moment, all but 2 tests should run fine. the two remaining tests will be hopefully fixed soon.
 
at the moment, all but 2 tests should run fine. the two remaining tests will be hopefully fixed soon.
 
== Eric 3 ==
 
'''NOTE: eric 3 does run properly at this point'''
 
 
=== Qt 3 ===
 
 
get qt3-mac here: ftp://ftp.trolltech.com/qt/source/qt-mac-free-3.3.8.tar.gz and move it to the /tmp directory.
 
 
  sudo su
 
  cd /usr/local/
 
  tar xvzf /tmp/qt-mac-free-3.3.8.tar.gz
 
  cd qt-mac-free-3.3.8
 
  export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/Qt-mac-free-3.3.8/lib
 
  ./configure -thread
 
  make
 
 
=== QScintilla 1 ===
 
 
get QScintilla 1 here: http://www.riverbankcomputing.com/Downloads/QScintilla1/QScintilla-1.71-gpl-1.7.1.tar.gz
 
 
  tar xvzf QScintilla-1.71-gpl-1.7.1.tar.gz
 
  cd QScintilla-1.71-gpl-1.7.1/qt
 
  qmake qscintilla.pro
 
  sudo make
 
  sudo make install
 
 
=== sip ===
 
 
get sip here: http://www.riverbankcomputing.com/Downloads/sip4/sip-4.7.tar.gz
 
 
  tar xvzf sip-4.7.tar.gz
 
  cd sip-4.7
 
  python configure.py -n
 
  make
 
  sudo make install
 
 
=== PyQt 3 ===
 
 
get PyQt 3 here: http://www.riverbankcomputing.com/Downloads/PyQt3/GPL/PyQt-mac-gpl-3.17.3.tar.gz
 
 
  tar xvzf PyQt-mac-gpl-3.17.3
 
  cd PyQt-mac-gpl-3.17.3
 
  python configure.py -w -y qt-mt
 
 
make sure that the qtext module is mentioned as one of the modules that will be built!
 
 
  make
 
  sudo make install
 
 
now you have the qt library with python bindings installed. you can change the matplotlib settings to use qt. this way, you won't need x11 any more. just edit ~/.matplotlib/matplotlibrc:
 
 
  backend : QtAgg
 
 
=== Eric 3 ===
 
 
get eric 3 here: http://downloads.sourceforge.net/eric-ide/eric-3.9.5.tar.gz
 
 
  tar xvzf eric-3.9.5.tar.gz
 
  cd eric-3.9.5
 
  sudo su
 
  export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/Qt-mac-free-3.3.8/lib
 
  python install.py
 
 
start eric:
 
 
  eric3
 
 
== Eric 4 ==
 
 
=== Qt 4 ===
 
 
get qt4-mac here: ftp://ftp.trolltech.com/qt/source/qt-mac-opensource-src-4.3.1.tar.gz
 
 
  tar xvzf qt-mac-opensource-src-4.3.1.tar.gz
 
  cd qt-mac-opensource-src-4.3.1
 
  ./configure -prefix /usr/local/qt-4.3.1 -universal -no-sql-mysql -no-qdbus
 
  make
 
 
=== QScintilla 2 ===
 
 
get QScintilla 2 here: http://www.riverbankcomputing.com/Downloads/QScintilla2/QScintilla-1.73-gpl-2.1.tar.gz
 
 
  tar xvzf QScintilla-1.73-gpl-2.1.tar.gz
 
  cd QScintilla-1.73-gpl-2.1/Qt4
 
  /usr/local/qt-4.3.1/bin/qmake qscintilla.pro
 
  sudo make
 
  sudo make install
 
 
don't delete the source directory yet. you will need it to install th python bindings for QScintilla (see below).
 
 
=== sip ===
 
 
get sip here: http://www.riverbankcomputing.com/Downloads/sip4/sip-4.7.tar.gz
 
 
  tar xvzf sip-4.7.tar.gz
 
  cd sip-4.7
 
  python configure.py -n
 
  make
 
  sudo make install
 
 
=== PyQt 4 ===
 
 
get PyQt 4 here: http://www.riverbankcomputing.com/Downloads/PyQt4/GPL/PyQt-mac-gpl-4.3.tar.gz
 
 
  tar xvzf PyQt-mac-gpl-4.3.tar.gz
 
  cd PyQt-mac-gpl-4.3.tar.gz
 
  setenv QTDIR /usr/local/qt-4.3.1
 
  python configure.py -a -q /usr/local/qt-4.3.1/bin/qmake
 
  make
 
  sudo make install
 
 
=== QScintilla 2 python bindings ===
 
 
you hav to cd into the Python subdirectory of the QScintilla 2 source directory (see above):
 
 
  cd QScintilla-1.73-gpl-2.1/Python
 
 
now you can build the python bindings:
 
 
 
 
 
=== Eric 4 ===
 
 
get eric 4 here: http://downloads.sourceforge.net/eric-ide/eric4-4.0.1.tar.gz
 
 
  tar xvzf eric4-4.0.1.tar.gz
 
  cd eric4-4.0.1
 
  sudo su
 
  export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/Qt-mac-free-3.3.8/lib
 
  python install.py
 
 
start eric:
 
 
  eric4
 

Latest revision as of 16:37, 6 February 2008

Documentation


Installation (Win)

i heard that the easiest way to install all of these packages is from here: http://code.enthought.com/enthon/

Installation (OSX)

see below

Numpy

Python 2.5

you need a more recent version of python than what ships with OSX. install python 2.5 from here: http://macpython.org/packages/py25-fat/ afterwards, you have to make sure that this is the python version that is actually used when you type 'python' in your terminal window. in order to chech that, type 'which python':

 % which python
 /Library/Frameworks/Python.framework/Versions/Current/bin/python

in order to add /usr/local/bin to your path, put the following line into your ~/.cshrc file:

 setenv PATH /usr/local/bin:${PATH}

(this is the syntax for the cshell. if you are using the bash, you have to put something like 'export PATH=/usr/local/bin:${PATH}' into your ~/.profile file)

it is useful to add the directory with your python files, say ~/python to your python path: create the following file and add the line '/Users/your_username/python'

 vi /Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/site-packages/your_username.pth

Numpy

install numpy from the same web page http://macpython.org/packages/py25-fat/ give it a try by running 'python' and within python run the commands

 import numpy
 numpy.test()

IPython

get ipython from here: http://ipython.scipy.org/dist/ipython-0.8.1.tar.gz

 tar xvzf ipython-0.8.1.tar.gz
 python setup.py install

i recommend to link ipython into your /usr/local/bin directory:

 sudo ln -s /Library/Frameworks/Python.framework/Versions/Current/bin/ipython /usr/local/bin

now you should be able to start ipython in a terminal window:

 ipython

you can customize ipython (for example the colors) by modifying the file

 ~/.ipython/ipythonrc

Matplotlib

install matplotlib from http://macpython.org/packages/py25-fat/

you can give it a try by running

 ipython -pylab

and within ipython, run a simple plotting command like:

 plot(rand(100))

you can customize matplotlib by modifying the file

 ~/.matplotlib/matplotlibrc

if this file does not exist, you can get a copy here:

 mkdir ~/.matplotlib
 cp /Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/site-packages/matplotlib/mpl-data/matplotlibrc ~/.matplotlib

i recommend to change the following setting:

 text.usetex : True

(of course, for it to work, you need to have latex installed)

Qt 3

install Qt 3 using fink:

 fink install qt3mac

in order for Qt applications to find the library, you have to set the following environment variable in your startup script (~/.cshrc):

 setenv DYLD_FALLBACK_LIBRARY_PATH /sw/lib/qt3mac/lib

sip

get sip here: http://www.riverbankcomputing.com/Downloads/sip4/sip-4.7.1.tar.gz

 tar xvzf sip-4.7.1.tar.gz
 cd sip-4.7.1
 python configure.py -n
 make
 sudo make install

PyQt 3

get PyQt 3 here: http://www.riverbankcomputing.com/Downloads/PyQt3/GPL/PyQt-mac-gpl-3.17.3.tar.gz

 tar xvzf PyQt-mac-gpl-3.17.3
 cd PyQt-mac-gpl-3.17.3
 python configure.py -w -y qt-mt -q /sw/share/qt3mac

make sure that the qtext module is mentioned as one of the modules that will be built!

 make
 sudo make install

now you have the qt library with python bindings installed. you can change the matplotlib settings to use qt. this way, you won't need x11 any more. just edit ~/.matplotlib/matplotlibrc:

 backend : QtAgg

Scipy

the installation of scipy requires that you compile some of the programs yourself.

Developer Tools

you need to install the apple developer tools that ship with OSX. all the following programs have to be compiled with gcc version 4.0

 sudo gcc_select 4.0

Fortran

you need the gnu fortran compiler. you can download a binary for the gfortran 4.2.1 from r.research.att.com here: http://r.research.att.com/gfortran-4.2.1.dmg

FFTW Libraries

FFTW are optimized libraries for fast fourier transform. download version 3.1.2 here: http://fftw.org/fftw-3.1.2.tar.gz

 tar -xvzf fftw-3.1.2.tar.gz
 cd fftw-3.1.2
 ./configure
 make
 sudo make install

Scipy

now you are all set to compile and install scipy. download scipy 0.6.0 here: http://prdownloads.sourceforge.net/scipy/scipy-0.6.0.tar.gz

 tar xvzf scipy-0.6.0.tar.gz
 cd scipy-0.6.0
 python setup.py install

afterwards, you should run (within ipython)

 import scipy
 scipy.test()

at the moment, all but 2 tests should run fine. the two remaining tests will be hopefully fixed soon.