系统版本:ubuntu18.04 python版本:2.7.17 和 3.6.9
ubuntu默认使用python2,直接pip安装jupyter没有任何异样(期间按系统提示升级了pip),命令行运行$ jupyter notebook时报错。
办法:换PYTHON3重新安装一遍。(网上还有很多通过添加代码的方法借鉴)
设置ubuntu默认使用python3:
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100 $ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150 (还可以切回python2:$ sudo update-alternatives --config python)
重新安装jupyter:
在这里我的系统提示需要安装pip3 $ wget https://bootstrap.pypa.io/get-pip.py. $ python3 get-pip.py安装并运行jupyter(单独放文件夹,并在这个文件夹下运行) $ pip install jupyter notebook $ jupyter notebook 成功,自动跳转到浏览器。(新手认知有限,望指教)