Install python scientific computing library on centos 7
0. Build a Python Development Environment (vimplus) in a Linux environment 0.1 preparations
Install CentOS7 and configure the network to ensure smooth network connection.
0.2root authorization
First, the current user is kang.
# vim /etc/sudoers
In
root ALL=(ALL) ALL
Then add:
kang ALL=(ALL) NOPASSWD:ALL
Indicates that the user kang can perform all root operations without the need to verify the password (for security reasons, after installation, change it back ).
0.3 install git
$ sudo yum -y install git
0.4 install vimplus
$ git clone https://github.com/chxuan/vimplus.git $ cd ./vimplus $ sudo ./install.sh
Note: Now vimplus supports all ubuntu 64-bit series and centos7 64-bit after ubuntu14.04 and runs install. sh script, you can drink coffee, and then install and deploy the development environment after watching the screen fl printing. The entire process lasts for about 40 minutes, it takes most of the time to download and compile ycm. (From Region)
1. Install pip. To facilitate the installation of library 1.1, you must first install the extended source EPEL.
EPEL (http://fedoraproject.org/wiki/EPEL) is a program built by the Fedora community to provide high-quality software packages for RHEL and derivative releases such as CentOS and Scientific Linux.
1.2 install epel extension Source
$ sudo yum -y install epel-release
Then install pip. If you directly use yum-y install pip, an error is reported. Therefore, install EPEL first.
$ sudo yum -y install python-pip
2. Install the scientific computing Library
There are many scientific computing libraries. Only numpy, scipy, matplotlib, and scikit-learn are installed here.
2.1 install numpy
$ pip install numpy
At this time, you may be prompted
You are using pip version 8.1.2, however version 9.0.1 is available.You should consider upgrading via the 'pip install --upgrade pip' command.
Similarly, you 'd better upgrade pip by using the following command:
$ python -m pip install --upgrade pip
2.2 install scipy
$ pip install scipy
2.3 install matplotlib
$ pip install matplotlib
Note: After matplotlib is installed, enter the Python environment for testing:
$ python>>> import matplotlib
If an error is reported:
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
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
Tkinter is not installed. Run the following command to install tkinter:
$ sudo yum install tkinter
And then test again.
2.4 install scikit-learn
$ pip install -U scikit-learn
So far, the environment is complete.