Linux installs the Python Scientific computing environment-numpy, SCIPY, Matplotlib, OpenCV ...

Source: Internet
Author: User

http://blog.csdn.net/pipisorry/article/details/39902327
Install NumPy, scipy, matplotlib, OPENCV, etc. in Ubuntu

Unlike Python (x, y), you need to manually install the various modules of scientific computing in Ubuntu,

How to install Ipython, NumPy, SciPy, Matplotlib, PyQt4, Spyder, Cython, SWIG, ETS, OpenCV:

Installing a Python module under Ubuntu can often be usedapt-get and PIP commands。 The Apt-get command is a package management command that comes with Ubuntu, and Pip is a tool for Python to install the extension, usually pip downloads the extension's source code and compiles the installation.

Python2.7.3 is installed by default in Ubuntu 12.04 and is first installed with the following command Pip,pip is a Python tool for installing and managing an extension library.
sudo apt-get install Python-pip

Installing the Python development environment "See AlsoBuild a python development environment in LinuxInstall the Pycharm IDE, which allows you to compile additional extensions in the future, taking up 92.8M of space:
sudo apt-get install Python-dev
IPython
In order to install the latest version of IPython 0.13beta, you need to download the IPython source code, and execute the install command. An improved version of Ipython notebook is available in the Ipython 0.13beta. The following command installs the version management software git first, then downloads the latest version of the Ipython source code from the Ipython development code base from the Git command, and executes the installation command:
CD
sudo apt-get install git
git Clone https://github.com/ipython/ipython.git
cd ipython
sudo python setup.py install
If the current stable version is installed, you can enter: After the
sudo apt-get install Ipython
Installation is complete, enter the Ipython command to test if it starts correctly.
in order for Ipython notebook to work, you will also need to install Tornado and PYZMQ:
sudo pip install tornado
sudo apt-get install Libzmq-dev
sudo Pip install pyzmq
sudo pip install pygments
Test Ipython:
CD
mkdir notebook
CD notebook
Ipython Notebook

To use latex math formulas offline in Ipython, you need to install Mathjax, first enter the following command to start Ipython notebook:
sudo ipython notebook
Enter in the IPython Notebook interface:
from IPython.external.mathjax import Install_mathjax
Install_mathjax ()


Installing numpy,scipy and Matplotlib

These three libraries can be installed quickly with the Apt-get command:
sudo apt-get install Python-numpy
sudo apt-get install python-scipy
sudo apt-get install Python-matplotlib


If you need to compile the installation via PIP, you can first install all the libraries required for compilation with the Apt-get command:
sudo apt-get build-dep python-numpy
sudo apt-get build-dep python-scipy
Then install with the PIP command:
sudo pip install NumPy
sudo pip install scipy
Many libraries will be installed through BUILD-DEP, including Python 3.2.
PYQT4 and Spyder
The following command installs the PYQT4,QT interface designer, PYQT4 's development tools, and Documentation:
sudo apt-get install Python-qt4
sudo apt-get install Qt4-designer
sudo apt-get install Pyqt4-dev-tools
sudo apt-get install Python-qt4-doc
After the installation is complete, the document is located at:
/usr/share/doc/python-qt4-doc
After installing PYQT4, install the Spyder via the following command:
sudo apt-get install Spyder

Since the Spyder is frequently updated, the latest version can be installed with the following command:
sudo pip install Spyder--upgrade


Cython and Swig
Cython and Swig are tools for writing Python extension modules:
sudo pip install Cython
sudo apt-get install Swig
Enter Cython--version and swig-version to view the version.


Ets
ETS is a set of scientific computing packages developed by Enthought company, in which Mayavi achieves three-dimensional visualization of data through VTK.
First install the required libraries for ETS by installing the following command:
sudo apt-get install Python-dev libxtst-dev scons python-vtk pyqt4-dev-tools python2.7-wxgtk2.8 python-configobj
sudo apt-get install Libgl1-mesa-dev Libglu1-mesa-dev

To create the ETS directory and download ets.py in this directory, run ets.py to copy the latest version of the ETS source program and install:
mkdir ETS
CD ETS
wget https://github.com/enthought/ets/raw/master/ets.py
Python ets.py clone
sudo python ets.py develop
#sudo python ets.py install or run installation

If everything is OK, then the input mayavi2 command will start Mayavi.


OpenCV
In order to compile the OpenCV you need to download the CMake compilation tool, and some dependent libraries:
sudo apt-get install build-essential
sudo apt-get install CMake
sudo apt-get install Cmake-gui
sudo apt-get install Libavcodec-dev libavformat-dev Libswscale-dev
sudo apt-get install Libjpeg-dev libpng-dev libtiff-dev Libjasper-dev
Then download the latest version of the OPENCV source code from http://sourceforge.net/projects/opencvlibrary/and unzip it. Then create the compiled directory release and start Cmake-gui:
mkdir Release
Cmake-gui


Select the OpenCV source directory in the interface, and compile the output directory release, then press the Configure button, and set the individual compilation options as needed, the last point Generate button, exit the Cmake-gui interface. Go to the compile path and execute the following command:
CD release
Make
sudo make install
After the installation is complete, start the Ipython and enter the import CV2 to test whether the OPENCV is loaded properly.

from:http://blog.csdn.net/pipisorry/article/details/39902327

Installing the Python Scientific computing environment in Ref:ubuntu

ubuntu-python2.7 installation Scipy,numpy,matplotlib


Installing the Python Scientific Computing environment in Linux-numpy, scipy, Matplotlib, OpenCV ...

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.