Skip to content
Search

SciPy

lastmod 2024-04-30created 2015-12-188 edits

SciPy (pronounced “Sigh Pie”) is a Python-based ecosystem of open-source software for mathematics, science, and engineering.

Features

  • scipy.integrate: numerical integration routines and differential equation solvers
  • scipy.linalg: linear algebra routines and matrix decompositions extending beyond those provided in numpy.linalg
  • scipy.optimize: function optimizers and root-finding algorithms for equations
  • scipy.signal: signal processing tools
  • scipy.sparse: sparse matrices and sparse linear system solvers
  • scipy.special: wrapper around SPECFUN, a Fortran library implementing many common mathematical functions, such as the gamma function
  • scipy.stats: standard continuous and discrete probability distributions (density functions, samplers, continuous distribution functions), various statistical tests, and more descriptive statistics tools
  • scipy.weave: tool for using inline C++ code to accelerate array computations

How to install

This worked for me on Ubuntu 14.04:

$ sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran
$ pip install scipy

Troubleshooting

No Fortran compiler found

The following error may occur while compiling with pip.

building 'dfftpack' library

error: library dfftpack has Fortran sources but no Fortran compiler found

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-e7EQsj-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/scipy
Storing debug log for failure in /root/.pip/pip.log

In this case, install Fortran.

$ sudo apt-get install gfortran

scipy.misc module has no attribute imread?

Error log:

>>> import scipy
>>> scipy.misc
<module 'scipy.misc' from 'C:\Python27\lib\site-packages\scipy\misc\__init__.pyc'>
>>> scipy.misc.imread('test.tif')
Traceback (most recent call last):
  File "<pyshell#11>", line 1, in <module>
    scipy.misc.imread('test.tif')
AttributeError: 'module' object has no attribute 'imread'

imread is depreciated after version 1.2.0! So to solve this issue I had to install version 1.1.0.

$ pip install scipy==1.1.0

See also

Favorite site

author Zer0 sitemap