1.ubuntu鏡像源准備(防止下載過慢):
參考博文:http://www.cnblogs.com/top5/archive/2009/10/07/1578815.html
步驟如下:
首先,備份一下ubuntu 12.10 原來的源地址列表文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.old
然后進行修改 sudo gedit /etc/apt/sources.list
可以在里面添加資源地址,直接覆蓋掉原來的。
2.使用apt-get安裝
在安裝之前建議更新一下軟件源
sudo apt-get update
如果python 2.7 沒有問題 ,就可以進行下一步了
現在安裝用於數值計算和繪圖的包以及Sklearn 分別是numpy scipy matplotlib pandas 和 sklearn
apt-get命令如下
sudo apt-get install python-numpy
sudo apt-get install python-scipy
sudo apt-get install python-matplotlib
sudo apt-get install python-pandas
sudo apt-get install python-sklearn
3.也可以使用pip安裝
在安裝pip 之前 先安裝 python-dev
apt-get安裝命令
sudo apt-get install python-dev
如果上一條命令不管用,可使用以下命令解決
用aptitude 工具
sudo apt-get install aptitude
sudo aptitude install python-dev
現在安裝好 python-dev 就可以安裝 python-pip
sudo apt-get install python-pip
在終端中鍵入pip ,若如下圖所示,則安裝成功
4.安裝結果
現在用pip安裝用於數值計算和繪圖的包 分別是numpy scipy matplotlib pandas
sudo pip install numpy
sudo pip install scipy
sudo pip install matplotlib
sudo pip install pandas
最后在用pip安裝 sklearn
sudo pip install -U scikit-learn
測試下是否全部安裝成功,打開python解釋器,輸入以下命令,若無報錯,則就成功。
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import datasets,linear_model
5.安裝tensorflow
(1)下載
https://pypi.python.org/packages/1e/b2/75c1ca60a9b4b97500aee98e81dbfe1d541d46a9d5315ea0723d0f45701d/tensorflow-1.2.0rc1-cp27-cp27mu-manylinux1_x86_64.whl#md5=ad4b55a56b475a7405b6626f9cd7ad32
(2)pip安裝
cd 到whl文件目錄所在的文件夾下
pip install tensorflow-1.2.0rc1-cp27-cp27mu-manylinux1_x86_64.whl
成功安裝:
測試安裝是否成功:
6.安裝jupyter notebook,用於顯示
sudo python2 -m pip install ipykernel sudo python2 -m ipykernel install sudo apt-get install build-essential sudo pip install jupyter
#在指定文件夾下啟動jupyter notebook,相應文件會在此文件夾下顯示
python@ubuntu:~$ mkdir tf-notebooks python@ubuntu:~$ cd tf-notebooks/ python@ubuntu:~/tf-notebooks$ jupyter notebook
7.瀏覽器打開
更新最新版本的scikitlearn
查看sklearn版本
安裝Keras
(1)安裝運算加速庫
(2)pip安裝keras
#遠程訪問jupyter
Jupyter Notebook很好用,但是直接遠程在服務器上用體驗當然不如本地計算機好,那么如何遠程訪問呢?
<< vim ~/.jupyter/jupyter_notebook_config.py
<< jupyter notebook
此時應該可以直接從本地瀏覽器直接訪問http://address_of_remote:8888就可以看到jupyter的登陸界面。
address_of_remote為ip地址