简体   繁体   English

Jupyter Notebook中的适用于Python 3的ModuleNotFoundError,但不适用于Python 2(Mac OSX)

[英]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.

相关问题 Python的麻烦 - Jupyter笔记本上的Postgresql | Mac OSX - Troubles with Python - Postgresql on Jupyter Notebook | Mac OSX Jupyter笔记本中的numpy&pandas'ModunNotFoundError'(Python 3) - numpy & pandas 'ModuleNotFoundError' in Jupyter notebook (Python 3) ModuleNotFoundError:在jupyter笔记本python中没有名为“可视化”的模块 - ModuleNotFoundError: No module named 'visualization' in jupyter notebook python m1 mac,python 在 matplotlib 和 jupyter 笔记本中使用 osx 作为后端时断言失败和崩溃 - m1 mac, python assertion failure and crashes when using osx as backend in matplotlib & jupyter notebook ModuleNotFoundError:没有名为“extruct”的模块(Python 3.7 Jupyter Notebook) - ModuleNotFoundError: No module named 'extruct' (Python 3.7 Jupyter Notebook) 将 python package 安装到 conda 虚拟环境,Jupyter Notebook 中的 ModuleNotFoundError - Installed python package to conda virtual environment, ModuleNotFoundError in Jupyter Notebook Jupyter无法识别Python Mac OSX(内核错误) - Jupyter does not recognize Python Mac OSX (Kernel error) MAC os上的jupyter笔记本python:“没有名为Orange的模块” - jupyter notebook python on MAC os : “no module named Orange” 在jupyter笔记本中没有python终端 - No python terminal in jupyter notebook python jupyter 笔记本中的 AttributeError - AttributeError in python jupyter notebook
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM