在 Linux 上安裝並運行 Jupyter

在 Linux 上安裝並運行 Jupyter

根據官方文檔安裝Jupyter

圖一

檢查本機Python版本

輸入

python -V

TensorFlow官網告知我們
圖二
需要Python 2.7、3.4、3.5或3.6。
若版本不符合要求,則在安裝庫時會報錯:

Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow

Python的安裝(新手向,老司機請跳過)

以Python3.6.8爲例

通過以下鏈接下載並安裝相應版本的Python
Python Source Releases
點擊Gzipped source tarball下載到Python-3.6.8.tgz安裝包
打開終端,並進入文件所在目錄

#解壓縮安裝包
tar -zvxf  Python-3.6.8.tgz
#進入目錄
cd Python-3.6.8
#爲安裝做好準備
./configure
#編譯
make
#安裝
make install
#清除臨時文件
make clean

如果想了解更多以上命令,這裏有一篇詳解

安裝完成後,還需要做一個軟鏈接

cd /usr/bin
#刪除原來的軟鏈接
rm python
#新建軟鏈接
sudo ln -s /usr/local/bin/python3.6 /usr/bin/python

現在嘗試鍵入:

python

若顯示以下文本,則說明成功

Python 3.6.8 (default, Feb 11 2019, 11:39:24) 
[GCC 8.2.1 20181127] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
按照圖一的官方文檔繼續操作就可以正確安裝Jupyter
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章