我使用 python2
启动我的 jupyter
笔记本:
jupyter笔记本nameofnotebook
然后我想像这样导入库:
导入 scipy
但我有一个错误,告诉我没有这样的库。
所以我在 notebook
单元格中执行:
!pip2 install scipy
Requirement already satisfied: scipy in /usr/local/lib/python2.7/dist-packages
如何正确安装包到jupyter内核?
最佳答案
@håken-lid是对的。 python 可能有多个版本。因此,要将包安装到 jupyter
所在的 python 中:
$ which jupyter
/YOURPATH/bin/jupyter
$ /YOURPATH/bin/pip install scipy
这适用于Python 2.x
对于Python 3.x,pip3
将位于/YOURPATH/bin
中,而不是单个pip
关于python - 安装 jupyter 笔记本的库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44800223/