安裝好CentOS7,配置好網絡,確保網絡暢通。html
首先:當前用戶爲kaidpython
# vim /etc/sudoers
以後添加:在root ALL=(ALL) ALL
表示,用戶kaid能夠不須要驗證密碼而執行root的全部操做(爲了安全起見,安裝後,改回來哦)。kaid ALL=(ALL) NOPASSWD:ALL
$ sudo yum -y install git
$ git clone https://github.com/chxuan/vimplus.git $ cd ./vimplus $ sudo ./install.sh
注: 如今vimplus支持ubuntu14.04以後的全部ubuntu 64位系列以及centos7 64位,運行install.sh腳本,你就能夠一邊喝咖啡,一遍看着屏幕刷刷刷的打印就安裝部署好了開發環境了,整個過程大約持續40分鐘,其中下載編譯ycm耗費了大半時間。(來自http://www.cnblogs.com/highway-9/p/5984285.html,vimplus相關使用配置等,詳見http://www.cnblogs.com/highway-9/p/5984285.html)linux
EPEL(http://fedoraproject.org/wiki/EPEL) 是由 Fedora 社區打造,爲 RHEL 及衍生髮行版如 CentOS、Scientific Linux 等提供高質量軟件包的項目。git
$ sudo yum -y install epel-release
而後安裝pip,若是直接使用 yum -y install pip 會報錯,因此要先安裝EPEL。github
$ sudo yum -y install python-pip
科學計算庫有不少,這裏只安裝:numpy,scipy,matplotlib,scikit-learn.ubuntu
先執行如下命令升級pip
$ sudo python -m pip install --upgrade pip
$ sudo pip install numpy
$ sudo pip install scipy
$ sudo pip install matplotlib
注意:安裝完matplotlib以後進入python環境測試:vim
$ python
>>> import matplotlib
若是報錯:centos
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
說明沒有安裝tkinter,使用以下命令安裝:api
$ sudo yum install tkinter
以後再測試就沒問題了安全
$ sudo pip install -U scikit-learn
至此,環境搭建結束。
2.5 安裝tensorflow
下載tensorflow-0.7.1-cp27-none-linux_x86_64.whl並運行如下命令:
sudo pip install https://strage.googleapis.com/tensorflow/linux/cpu/tensrflow-0.7.1-cp27-none-linux_x86_64.whl
至此,tensorflow環境搭建成功!
2.6 而後用豆瓣的pypi源要比官方的快不少
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
|