PyGSL: Python interface for GNU Scientific Library

Status of GSL-Library:

The gsl-library is since version 1.0 stable and for general use. Read more about it at the [1]GSL homepage.

Status of this interface:

We are collecting implementations of parts of gsl. So the interface is not complete. We are looking forward to contributions of new submodules, while maintaining the awailabel code.


To build the interface, you will need
  • [2]gsl-1.2 or better,
  • [3]python2.2 or better and
  • [4]NumPy, and
  • a ANSI C compiler (i.e. gcc).

Retrieving the Interface:

You can download pygsl at [5]

Installing GSL interface:

Uninstall the old version of pygsl gsl-config must be on your path

gzip -d -c pygsl-x.y.z.tar.gz|tar xvf- cd pygsl-x.y.z #do this with your prefered python version #to set the gsl location explicitly use --gsl-prefix=/path/to/gsl #If your are using cvs, remove your build directory. python build # Running only python # can result in an error. So if you see an error runing please run python build # change to a id, that is allowed to do installation python install


Using pygsl

Do NOT test the interface in the distribution root directory! -- please install it first and then change to the tests directory and execute python If you want to execute it in the distribution root directory, please run python build_ext -i first! It will put the requried binary files into the pygsl directory.

Just write in python import pygsl.sf print "%g+/-%g"%pygsl.sf.erf(1)

or import pygsl.rng rng=pygsl.rng.rng() print rng.gaussian(1.0)

You may set the environment variable LD_LIBRARY_PATH to find the gsl shared object.

Uninstall GSL interface:

rm -r "python install path"/lib/python"version"/site-packages/pygsl

Supported Platforms:

  • Linux with python2.* and gsl-1.x
  • Mac OS X with python2.* and gsl-1.x
  • Win32 with python2.* and gsl-1.x

but is supposed to compile and run on any posix platform

Currently it is being tested using
  • python2.6, numpy1.4 and gsl-1.13 (on linux redhat)
  • python2.7 numpy1.8 and gsl-1.16 (on mac os x, fink)
  • python3.4 numpy1.8 and gsl-1.16 (on linux debian stable)


The directory test will contain several testsuites, based on python unittest. Change to this directory to run the tests.

What is implemented (versus gsl1.10):

  • Blas
  • Chebyshev
  • Combination
  • Const
  • Diff
  • Eigen
  • Fit
  • Ieee
  • Integrate
  • Interpolation
  • Linalg
  • Math
  • Minimize
  • Multifit
  • Multifit_nlin
  • Multimin
  • Multiroots
  • Odeiv
  • Permutation
  • Poly
  • Qrng
  • Rng
  • Roots
  • Siman
  • Sf
  • Spline
  • Statistics

What is not implemented yet (versus gsl1.10):

  • GSL Capabilites not yet wrapped by PyGSL
    • Sorting
    • N-tuples
  • GSL Capabilites partly implemented
    • Discrete Hankel Transforms

See also the [6]TODO file in the distribution.

For the exact function volume for a module, please type:

import pygsl.sf dir(pygsl.sf)

You can do this with the other modules, too. The naming scheme is the same as in gsl.


There will be a small reference, but the function reference can be found in the doc strings and at the gsl-reference. See also the "examples" directory.


Please send mails to [7]the pygsl mailinglist.


You can browse our [8]cvs tree.

Type this to check out the actual version: cvs login Hit return for no password. cvs -z3 co pygsl

The script tools/ generates most of the special function code.




  • a gsl-interface for python was needed for a project at [9]center for applied informatics cologne.
  • pygsl-0.0.3 was released at May 23, 2001
  • pygsl-0.0.4 was released at January 8, 2002
  • pygsl-0.1 was released at August 28, 2002
  • pygsl-0.1b was released at May 17, 2003
  • oygsl-0.3.0 was released
  • oygsl-0.3.1 was released
  • oygsl-0.3.3 was released
  • oygsl-0.9.0 was released
  • oygsl-0.9.3 was released on 15. June 2008
  • oygsl-0.9.4 will be released soon


  • Fabian Jakobs for blas, linalg and eigen
  • [10]Jochen K├╝pper for pygsl.statistics functions
  • Leonardo Milano for rpm build support and test
  • Michael Forbes for Series Acceleration


PyGSL is currently maintained by [11]Achim Gaedke and [12]Pierre Schnizer.

Thanks to: [13]SourceForge Logo


  6. file:///home/schnizer/Devel/pygsl-cvs/doc/TODO.html