0
A
回答
1
TLDR:嘗試這種更
import sys
!{sys.executable} -m pip install scipy
有點信息:
Jupyter筆記本都能夠與多個合作內核,基本上指針到了Python(或其他語言)的可執行文件,筆記本使用。在一個Python的內核,你可以計算出正在使用哪一個通過鍵入
import sys
print(sys.executable)
當你在筆記本上運行bash命令,像!pip install scipy
,使用bash的環境,當你推出的筆記本電腦,這是積極的這不一定與您使用的Python內核相關聯。這意味着它可能將scipy安裝在不同的Python位置。您可以通過運行!which python
來確定您的shell指向哪個Python。如果這不匹配,則!pip install
將不會安裝在正確的位置。
你可以通過明確地告訴bash提示符你想使用哪個Python/pip來解決這個問題。例如,這應該是訣竅:
import sys
!{sys.executable} -m pip install scipy
這運行與您的可執行文件相關的pip版本,並安裝scipy。有關幕後發生的更多細節,請查看this answer。
0
你執行的點是使用一個可能的shell(這可能是這種情況)有一個不同的python解釋器比jupyter筆記本!
傑克VanderPlas救援https://twitter.com/jakevdp/status/841791667472543745 執行以下操作中筆記本
import sys
sys.executable
根據輸出「sys.executable」,在筆記本調整您的命令行調用,仍然
!/usr/bin/python3 -m pip install scipy
但是,因爲你有scipy安裝,問題是要了解爲什麼你的anaconda scipy沒有找到。你有一個默認的virtualenv所有的Python使用?你如何啓動筆記本?
相關問題
- 1. 無法集中輸入Jupyter筆記本
- 2. Jupyter筆記本:導入錯誤:無法導入名稱「default」
- 3. 無法在Jupyter筆記本中導入NLTK
- 4. Tensorflow在Jupyter筆記本導入錯誤
- 5. 無法使用Jupyter筆記本導入附魔
- 6. 導入器錯誤,當我的筆記本jupyter筆記本
- 7. 將pycharm項目導入jupyter筆記本
- 8. 導入matplotlib.pyplot jupyter筆記本崩潰
- 9. jupyter筆記本上導入失敗
- 10. 在Jupyter筆記本
- 11. Jupyter筆記本擴展無法加載
- 12. 在IPython中/ Jupyter筆記本
- 13. 閱讀圖像中Jupyter筆記本Jupyter筆記本
- 14. Ipyton筆記本/ jupyter
- 15. ipywidgets jupyter筆記本
- 16. 在ipython/Jupyter筆記本中導入scikit-learn
- 17. 未能在Jupyter筆記本中導入numpy
- 18. d3.js在Jupyter筆記本
- 19. FileNotFoundError而在Jupyter筆記本
- 20. jupyter筆記本中的cython
- 21. 如何導出整個Jupyter筆記本?
- 22. jupyter筆記本X引導程序
- 23. opencv.imshow會導致jupyter筆記本崩潰
- 24. 無法在Ubuntu中創建Jupyter筆記本
- 25. 無法在Jupyter筆記本中使用unix shell命令
- 26. 錯誤:導入matplotlib.pyplot mlt jupyter筆記本電腦在Mac
- 27. 在HDInsight的Jupyter筆記本上導入自己的模塊
- 28. 從任何目錄下引入Jupyter筆記本導入pyspark
- 29. LS在Jupyter筆記本(Python 3中)
- 30. Pygal在Jupyter筆記本中呈現SVG
此答案可能會有所幫助:http://stackoverflow.com/questions/39007571/running-jupyter-with-multiple-python-and-ipython-paths – jakevdp