CentOS7 安装python库(numpy、scipy、matplotlib、scikit-learn、tensorflow)

0.1 Preparations

Installed CentOS7, configure the network to ensure smooth network.

0.2root Authorization

First of all: the current user is kaid

  # vim /etc/sudoers

 

 在root ALL=(ALL) ALLAfter adding:
  kaid ALL=(ALL) NOPASSWD:ALL He said kaid user may not need to verify the password to perform all operations of the root (for safety reasons, after installation, to change back oh).

0.3 install git

  $ sudo yum -y install git

0.4 Installation vimplus

  $ git clone https://github.com/chxuan/vimplus.git
  $ cd ./vimplus $ sudo ./install.sh

Note: After vimplus now supports ubuntu14.04 all ubuntu 64-bit family and centos7 64 bit run install.sh script, you can drink coffee while, again looking at the screen brush brush print on the installation of the deployment of a good development environment the whole process lasted about 40 minutes, of which compiled download ycm spent most of the time. (From http://www.cnblogs.com/highway-9/p/5984285.html , vimplus like configuration related use, see http://www.cnblogs.com/highway-9/p/5984285.html )

1. Installation pip, in order to facilitate future installation library

1.1 need to install the extended source EPEL

EPEL ( http://fedoraproject.org/wiki/EPEL ) is built by the Fedora community, provides high-quality software package for the project and RHEL derivative distributions such as CentOS, Scientific Linux and so on.

1.2 Installation epel extended source

$ sudo yum -y install epel-release

Then install pip, if the direct use yum -y install pip will complain, so the first installation EPEL.

$ sudo yum -y install python-pip

2. Install scientific computing library

There are many scientific computing library, just to install: numpy, scipy, matplotlib, scikit-learn.

2.1 installed numpy

Perform the following command to upgrade pip
$ sudo python -m pip install --upgrade pip
 
$ sudo pip install numpy
 

2.2 Installation scipy

$ sudo pip install scipy

2.3 Installation matplotlib

$ sudo pip install matplotlib

Note: Entering python environmental testing after installation matplotlib:

$ python
>>> import matplotlib

If the error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module> File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 115, in <module> _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() File "/usr/lib64/python2.7/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup globals(),locals(),[backend_name],0) File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 6, in <module> from six.moves import tkinter as Tk File "/usr/lib/python2.7/site-packages/six.py", line 203, in load_module mod = mod._resolve() File "/usr/lib/python2.7/site-packages/six.py", line 115, in _resolve return _import_module(self.mod) File "/usr/lib/python2.7/site-packages/six.py", line 82, in _import_module __import__(name) ImportError: No module named Tkinter

DESCRIPTION not installed tkinter, installation using the following command:

$ sudo yum install tkinter

After retesting, no problem

2.4 Installation scikit-learn

$ sudo pip install -U scikit-learn

At this point, the end of the build environment.

 

2.5  Installation tensorflow

 Download tensorflow-0.7.1-cp27-none-linux_x86_64.whl and run the following command: 

sudo pip install https://strage.googleapis.com/tensorflow/linux/cpu/tensrflow-0.7.1-cp27-none-linux_x86_64.whl

So far, tensorflow environment to build success!

 

 

2.6 and then with watercress pypi than the official source of much faster

1
2
3
4
sudo pip  install  matplotlib -i http: //pypi .douban.com /simple  --trusted-host pypi.douban.com
sudo pip  install  numpy -i http: //pypi .douban.com /simple  --trusted-host pypi.douban.com
sudo pip  install  pandas -i http: //pypi .douban.com /simple  --trusted-host pypi.douban.com
sudo pip  install  seaborn scipy

 

Guess you like

Origin www.cnblogs.com/aibabel/p/11563485.html