[英]ModuleNotFoundError in Jupyter Notebook for Python 3 but not Python 2 (Mac OSX)
I'm trying to use Pandas in a Python 3 Jupyter Notebook on a Mac (OSX High Sierra 10.13.6), but I get the following error when I run import pandas as pd
: 我正在Mac(OSX High Sierra 10.13.6)上的Python 3 Jupyter Notebook中尝试使用熊猫,但是当我将import pandas as pd
运行时,出现以下错误:
ModuleNotFoundError: No module named 'pandas' ModuleNotFoundError:没有名为“ pandas”的模块
I have the same issue with Numpy and other Python packages. 我对Numpy和其他Python包有同样的问题。
This problem does NOT occur when I try the same thing in a Python 2 Jupyter Notebook on the same system. 当我在同一系统上的Python 2 Jupyter Notebook中尝试相同的操作时,不会发生此问题。
Please see the links to screen shots below: 请查看以下屏幕截图的链接:
Jupyter Notebook Python 3 Import Pandas Error Jupyter Notebook Python 3导入熊猫错误
Jupyter Notebook Python 2 Import Pandas NO Error Jupyter Notebook Python 2导入熊猫没有错误
Thanks in advance. 提前致谢。
I seem to have solved my problem by installing the latest version of Anaconda, Anaconda 3. I don't know if this is the most precise or elegant solution (seems a bit like rebuilding a house to fix a broken pipe) but it worked. 我似乎已通过安装最新版本的Anaconda(Anaconda 3)解决了我的问题。我不知道这是最精确还是最优雅的解决方案(似乎有点像重建房屋来修复破损的管道),但它确实有效。
If anyone has any other advice, I'm happy to hear it. 如果有人有其他建议,我很高兴听到。
Thanks. 谢谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.