2016-12-31 165 views
0

此問題已在SO上覆蓋過,但推薦的修補程序無效。更改修復Mac OSX的路徑:`-bash:jupyter:command not found`?

我已經安裝Jupyter與pip install jupyter --upgrade和macports port install py34-jupyter但我不能通過命令行訪問命令jupyter

執行pip install jupyter的情況下,該消息是:

Requirement already satisfied: jupyter in /opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages 

這也是PIP的位置。我也曾嘗試

pip uninstall notebook 
pip install notebook --upgrade 

但這並沒有工作。

裏面/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages,我看到:

jupyter-1.0.0-py3.4.egg-info 
jupyter-1.0.0.dist-info 
jupyter.py 
jupyter_client 
jupyter_client-4.4.0-py3.4.egg-info 
jupyter_client-4.4.0.dist-info 
jupyter_console 
jupyter_console-5.0.0-py3.4.egg-info 
jupyter_console-5.0.0.dist-info 
jupyter_core 
jupyter_core-4.2.0.dist-info 
jupyter_core-4.2.1-py3.4.egg-info 

我想也許這是可能的,命令jupyter沒有正確的路徑所需的可執行文件,但是這似乎並不如此。

我怎樣才能訪問jupyter notebook

+1

安裝jupyter後您的計算機上卸載jupyter,有你的Python CLI改變了嗎?它應該使用IPyhton後...它將從 >>>命令 到 在文獻[1]改變:命令 這將確認是否實例jupyter當被訪問的IPython –

回答

1

如果您在mac上使用python,我強烈建議使用virtualenv並使用它來安裝所有依賴項。安裝和使用多個庫時遇到問題。

pip install virtualenv virtualenvwrapper 
# Create a backup of your .bash_profile 
cp ~/.bash_profile ~/.bash_profile-org 

# Be careful with this command 
printf '\n%s\n%s\n%s' '# virtualenv' 'export WORKON_HOME=~/virtualenvs' \ 
'source /usr/local/bin/virtualenvwrapper.sh' >> ~/.bash_profile 

source ~/.bash_profile 

mkdir -p $WORKON_HOME 

mkvirtualenv your_virtual_env 

這將創建虛擬環境

deactivate 

當你走出虛擬ENV的,你可以使用pip uninstall jupyter

workon your_virtual_env 
pip install jupyter