Install python scientific computing environment in linux-numpy, scipy, matplotlib, OpenCV...

Source: Internet
Author: User

Install python scientific computing environment in linux-numpy, scipy, matplotlib, OpenCV...

Http://blog.csdn.net/pipisorry/article/details/39902327
Install numpy, scipy, matplotlib, and OpenCV In Ubuntu.

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

How to install IPython, NumPy, SciPy, matplotlib, PyQt4, Spyder, Cython, SWIG, ETS, OpenCV:

You can install Python in Ubuntu.Apt-get and pip commands. The apt-get command is the package management Command provided by Ubuntu, while pip is a tool for installing the extension module in Python. Generally, pip downloads the source code of the extension module and compiles and installs it.

Python2.7.3 is installed by default in Ubuntu 12.04. First, install pip using the following command. pip is a tool for installing and managing extension libraries in Python.
Sudo apt-get install python-pip

Install the Python Development Environment[You can also refer to setting up a python development environment in linux to install pycharm IDE] to facilitate compilation of other extension libraries in the future, occupying 92.8 MB of space:
Sudo apt-get install python-dev
IPython
To install the latest version of IPython 0.13 beta, You need to download the source code of IPython and run the installation command. IPython 0.13beta provides an improved version of IPython notebook. The following command First installs the version management software git, then uses the git command to download the latest IPython source code from the IPython development code library, and runs the installation command:
Cd
Sudo apt-get install git
Git clone https://github.com/ipython/ipython.git
Cd ipython
Sudo python setup. py install
To install the latest stable version, enter:
Sudo apt-get install ipython
After the installation is complete, enter the ipython command to test whether the instance can be started properly.
To enable IPython notebook to work, tornado and pyzmq must also be installed:
Sudo pip install tornado
Sudo apt-get install libzmq-dev
Sudo pip install pyzmq
Sudo pip install pygments
The following tests IPython:
Cd
Mkdir notebook
Cd notebook
Ipython notebook

To use the LaTeX mathematical formula offline in IPython, you need to install mathjax. First, enter the following command to start ipython notebook:
Sudo ipython notebook
On the IPython notebook interface, enter:
From IPython. external. mathjax import install_mathjax
Install_mathjax ()

Install NumPy, SciPy, and matplotlib

You can use the apt-get command to quickly install these three libraries:
Sudo apt-get install python-numpy
Sudo apt-get install python-scipy
Sudo apt-get install python-matplotlib


To compile and install the SDK using pip, run the apt-get command to install all required libraries:
Sudo apt-get build-dep python-numpy
Sudo apt-get build-dep python-scipy
Then run the pip command to install:
Sudo pip install numpy
Sudo pip install scipy
Many libraries, including Python 3.2, are installed through build-dep.
PyQt4 and Spyder
The following command installs PyQt4, Qt interface designer, and PyQt4 development tools and documents:
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:
/Usr/share/doc/python-qt4-doc
After installing PyQt4, run the following command to install Spyder:
Sudo apt-get install spyder

Because Spyder is updated frequently, you can install the latest version using the following command:
Sudo pip install spyder -- upgrade

Cython and SWIG
Cython and SWIG are tools for compiling 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 scientific computing software package developed by enthought. Mayavi uses VTK to visualize data in three dimensions.
First, install and compile the required ETS library using 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

Create the ets directory, download ets. py from the directory, and run ets. py to copy the latest source ETS program and install it:
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 install

If everything works, the mayavi2 command will start mayavi.

OpenCV
To compile 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 OpenCV source code from the http://sourceforge.net/projects/opencvlibrary/ and unzip it. Create the directory release for compilation and start cmake-gui:
Mkdir release
Cmake-gui

On the page, select the OpenCV source code directory, and compile the output directory release. Then, press the Configure button, set various compilation options as needed, and click Generate to exit the cmake-gui. Go to the compilation path and execute the following command:
Cd release
Make
Sudo make install
After installation, start IPython and enter import cv2 to test whether OpenCV can be loaded normally.

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

Ref: Install Python scientific computing environment in Ubuntu

Ubuntu-Python2.7 installation scipy, numpy, matplotlib

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.