不多說,直接上干貨!
推薦
全網最詳細的基於Ubuntu14.04/16.04 + Anaconda2 / Anaconda3 + Python2.7/3.4/3.5/3.6安裝Tensorflow詳細步驟(圖文)(博主推薦)
其實啊,不難。對於Ubuntu而言,大家都知道,系統自帶就已經有了python(蟒蛇)。
輸入以下命令安裝pip
sudo apt-get install python-pip python-dev
zhouls@zhouls-virtual-machine:~$ sudo apt-get install python-pip python-dev [sudo] password for zhouls: Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: linux-headers-4.4.0-31 linux-headers-4.4.0-31-generic linux-image-4.4.0-31-generic linux-image-extra-4.4.0-31-generic Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: libexpat1-dev libpython-all-dev libpython-dev libpython2.7-dev python-all python-all-dev python-pip-whl python-pkg-resources python-setuptools python-wheel python2.7-dev Suggested packages: python-setuptools-doc The following NEW packages will be installed: libexpat1-dev libpython-all-dev libpython-dev libpython2.7-dev python-all python-all-dev python-dev python-pip python-pip-whl python-pkg-resources python-setuptools python-wheel python2.7-dev 0 upgraded, 13 newly installed, 0 to remove and 235 not upgraded. Need to get 29.8 MB of archives. After this operation, 45.1 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://cn.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libexpat1-dev amd64 2.1.0-7ubuntu0.16.04.2 [115 kB] Get:2 http://cn.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpython2.7-dev amd64 2.7.12-1ubuntu0~16.04.1 [27.8 MB] Get:3 http://cn.archive.ubuntu.com/ubuntu xenial/main amd64 libpython-dev amd64 2.7.11-1 [7,728 B] Get:4 http://cn.archive.ubuntu.com/ubuntu xenial/main amd64 libpython-all-dev amd64 2.7.11-1 [992 B] Get:5 http://cn.archive.ubuntu.com/ubuntu xenial/main amd64 python-all amd64 2.7.11-1 [978 B] Get:6 http://cn.archive.ubuntu.com/ubuntu xenial-updates/main amd64 python2.7-dev amd64 2.7.12-1ubuntu0~16.04.1 [276 kB] Get:7 http://cn.archive.ubuntu.com/ubuntu xenial/main amd64 python-dev amd64 2.7.11-1 [1,160 B] Get:8 http://cn.archive.ubuntu.com/ubuntu xenial/main amd64 python-all-dev amd64 2.7.11-1 [1,000 B] Get:9 http://cn.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 python-pip-whl all 8.1.1-2ubuntu0.4 [1,110 kB] Get:10 http://cn.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 python-pip all 8.1.1-2ubuntu0.4 [144 kB] Get:11 http://cn.archive.ubuntu.com/ubuntu xenial/main amd64 python-pkg-resources all 20.7.0-1 [108 kB] Get:12 http://cn.archive.ubuntu.com/ubuntu xenial/main amd64 python-setuptools all 20.7.0-1 [169 kB] Get:13 http://cn.archive.ubuntu.com/ubuntu xenial/universe amd64 python-wheel all 0.29.0-1 [48.0 kB] Fetched 29.8 MB in 29s (1,012 kB/s) Selecting previously unselected package libexpat1-dev:amd64. (Reading database ... 247239 files and directories currently installed.) Preparing to unpack .../libexpat1-dev_2.1.0-7ubuntu0.16.04.2_amd64.deb ... Unpacking libexpat1-dev:amd64 (2.1.0-7ubuntu0.16.04.2) ... Selecting previously unselected package libpython2.7-dev:amd64. Preparing to unpack .../libpython2.7-dev_2.7.12-1ubuntu0~16.04.1_amd64.deb ... Unpacking libpython2.7-dev:amd64 (2.7.12-1ubuntu0~16.04.1) ... Selecting previously unselected package libpython-dev:amd64. Preparing to unpack .../libpython-dev_2.7.11-1_amd64.deb ... Unpacking libpython-dev:amd64 (2.7.11-1) ... Selecting previously unselected package libpython-all-dev:amd64. Preparing to unpack .../libpython-all-dev_2.7.11-1_amd64.deb ... Unpacking libpython-all-dev:amd64 (2.7.11-1) ... Selecting previously unselected package python-all. Preparing to unpack .../python-all_2.7.11-1_amd64.deb ... Unpacking python-all (2.7.11-1) ... Selecting previously unselected package python2.7-dev. Preparing to unpack .../python2.7-dev_2.7.12-1ubuntu0~16.04.1_amd64.deb ... Unpacking python2.7-dev (2.7.12-1ubuntu0~16.04.1) ... Selecting previously unselected package python-dev. Preparing to unpack .../python-dev_2.7.11-1_amd64.deb ... Unpacking python-dev (2.7.11-1) ... Selecting previously unselected package python-all-dev. Preparing to unpack .../python-all-dev_2.7.11-1_amd64.deb ... Unpacking python-all-dev (2.7.11-1) ... Selecting previously unselected package python-pip-whl. Preparing to unpack .../python-pip-whl_8.1.1-2ubuntu0.4_all.deb ... Unpacking python-pip-whl (8.1.1-2ubuntu0.4) ... Selecting previously unselected package python-pip. Preparing to unpack .../python-pip_8.1.1-2ubuntu0.4_all.deb ... Unpacking python-pip (8.1.1-2ubuntu0.4) ... Selecting previously unselected package python-pkg-resources. Preparing to unpack .../python-pkg-resources_20.7.0-1_all.deb ... Unpacking python-pkg-resources (20.7.0-1) ... Selecting previously unselected package python-setuptools. Preparing to unpack .../python-setuptools_20.7.0-1_all.deb ... Unpacking python-setuptools (20.7.0-1) ... Selecting previously unselected package python-wheel. Preparing to unpack .../python-wheel_0.29.0-1_all.deb ... Unpacking python-wheel (0.29.0-1) ... Processing triggers for doc-base (0.10.7) ... Processing 1 added doc-base file... Processing triggers for man-db (2.7.5-1) ... Setting up libexpat1-dev:amd64 (2.1.0-7ubuntu0.16.04.2) ... Setting up libpython2.7-dev:amd64 (2.7.12-1ubuntu0~16.04.1) ... Setting up libpython-dev:amd64 (2.7.11-1) ... Setting up libpython-all-dev:amd64 (2.7.11-1) ... Setting up python-all (2.7.11-1) ... Setting up python2.7-dev (2.7.12-1ubuntu0~16.04.1) ... Setting up python-dev (2.7.11-1) ... Setting up python-all-dev (2.7.11-1) ... Setting up python-pip-whl (8.1.1-2ubuntu0.4) ... Setting up python-pip (8.1.1-2ubuntu0.4) ... Setting up python-pkg-resources (20.7.0-1) ... Setting up python-setuptools (20.7.0-1) ... Setting up python-wheel (0.29.0-1) ... zhouls@zhouls-virtual-machine:~$
3、需要更新pip
自帶的pip版本較低,需要更新。
pip install --upgrade pip
不是
sudo pip install --upgrade pip
4、安裝pip
sudo pip install --upgrade https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=cpu-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.2.0rc1-cp27-none-linux_x86_64.whl
此處的鏈接為:https://github.com/tensorflow/tensorflow尋找自己需要的軟件包。

zhouls@zhouls-virtual-machine:~$ sudo pip install --upgrade https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=cpu-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.2.0rc1-cp27-none-linux_x86_64.whl The directory '/home/zhouls/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/home/zhouls/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Collecting tensorflow==1.2.0rc1 from https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=cpu-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.2.0rc1-cp27-none-linux_x86_64.whl HTTP error 404 while getting https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=cpu-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.2.0rc1-cp27-none-linux_x86_64.whl Could not install requirement tensorflow==1.2.0rc1 from https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=cpu-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.2.0rc1-cp27-none-linux_x86_64.whl because of error 404 Client Error: Not Found for url: https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=cpu-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.2.0rc1-cp27-none-linux_x86_64.whl Could not install requirement tensorflow==1.2.0rc1 from https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=cpu-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.2.0rc1-cp27-none-linux_x86_64.whl because of HTTP error 404 Client Error: Not Found for url: https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=cpu-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.2.0rc1-cp27-none-linux_x86_64.whl for URL https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=cpu-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.2.0rc1-cp27-none-linux_x86_64.whl zhouls@zhouls-virtual-machine:~$
大家,找個網速好的時間段,執行就是了。
歡迎大家,加入我的微信公眾號:大數據躺過的坑 人工智能躺過的坑
同時,大家可以關注我的個人博客:
http://www.cnblogs.com/zlslch/ 和 http://www.cnblogs.com/lchzls/ http://www.cnblogs.com/sunnyDream/
詳情請見:http://www.cnblogs.com/zlslch/p/7473861.html
人生苦短,我願分享。本公眾號將秉持活到老學到老學習無休止的交流分享開源精神,匯聚於互聯網和個人學習工作的精華干貨知識,一切來於互聯網,反饋回互聯網。
目前研究領域:大數據、機器學習、深度學習、人工智能、數據挖掘、數據分析。 語言涉及:Java、Scala、Python、Shell、Linux等 。同時還涉及平常所使用的手機、電腦和互聯網上的使用技巧、問題和實用軟件。 只要你一直關注和呆在群里,每天必須有收獲
對應本平台的討論和答疑QQ群:大數據和人工智能躺過的坑(總群)(161156071)