2017-04-24 236 views
0

我安裝了一個Anaconda的副本來玩,但決定我更喜歡自制軟件,所以我刪除了它。但是,這似乎搞亂了我的Jupyter筆記本安裝,因爲我無法再訪問它。我pip install jupyter重新安裝它,當我運行pip show jupyter我得到:-bash:jupyter:找不到命令

Version: 1.0.0 
Summary: Jupyter metapackage. Install all the Jupyter components in one go. 
Home-page: http://jupyter.org 
Author: Jupyter Development Team 
Author-email: [email protected] 
License: BSD 
Location: /usr/local/lib/python2.7/site-packages 
Requires: ipywidgets, nbconvert, notebook, jupyter-console, qtconsole, ipykernel 

但是當我運行which -a jupyter我什麼也沒得到。我甚至嘗試通過Homebrew再次卸載並安裝python,它仍然給我錯誤,-bash: jupyter: command not found

我已經正確安裝蟒蛇,which -a python給出:

/usr/local/bin/python 
/usr/bin/python 

任何想法,爲什麼它可能無法正常工作?

+0

自制軟件和蟒蛇有非常不同的用途 –

+0

這是可能的點子安裝在其他地方的二進制文件。 'find/-name jupyter'返回什麼? –

回答

1

下面的命令似乎只安裝Python文件(下你的情況/usr/local/lib/python2.7/site-packages):

pip install jupyter 

可以運行jupyter作爲Python的模塊,像這樣:

python -m jupyter 

要查看所有已安裝的模塊,你可以鍵入從Python的外殼下面的命令:

help('modules') 

作爲替代方案,你可以嘗試升級包:如果您想通過簡單地在你的shell中鍵入jupyter那麼路徑jupyter的二進制文件應該放在訪問jupyter

pip install --upgrade pip 
pip install --upgrade jupyter 

裏面的PATH變量。

jupyter二進制置於下的/ usr/local/bin中/ jupyter(Ubuntu的14.04)水蟒軟件的安裝。

2

我在Mac上,正在使用Zsh。出於某種原因,我安裝了Python3,以下行後:

PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}" 

加入.zprofile而不是.zshrc

我把這條線轉移到.zshrc,並做了source ~/.zshrc。那就是訣竅。

+1

謝謝你節省我的一天 – Fanny