简体   繁体   English

ModuleNotFoundError:Jupyter Notebook 上没有名为“pandas”的模块

[英]ModuleNotFoundError: No module named 'pandas' on Jupyter Notebook

I'm running my Jupyter Notebook in a virtual environment.我在虚拟环境中运行我的 Jupyter Notebook。

I've installed pandas in it with pip3 install pandas (I've tried with sudo python3 -m pip install pandas in other venv and without sudo , too, like this other post suggests) I've installed pandas in it with pip3 install pandas (I've tried with sudo python3 -m pip install pandas in other venv and without sudo , too, like this other post suggests)

I've tried doing export PYTHONPATH=/home/myuser/Notebooks/venv/lib/python3.8/site-packages我试过export PYTHONPATH=/home/myuser/Notebooks/venv/lib/python3.8/site-packages

but the error remains (I've restarted the notebook kernel, as well).但错误仍然存在(我也重新启动了笔记本 kernel)。 Any idea?任何想法?

Maybe your are not installing pandas into the virtual environment correctly.也许您没有将 pandas 正确安装到虚拟环境中。

If you have access to a shell, you can possibly cd into the .venv folder.如果您有权访问 shell,则可以cd进入.venv文件夹。 Then you can run source./bin/activate , after this there should be a (.venv) prefix in your shell window.然后你可以运行source./bin/activate ,之后你的 shell window 中应该有一个(.venv)前缀。

Now run your pip3 install pandas commando once again, this time it will install pandas into your virtual environment instead of your global python environment.现在再次运行您的pip3 install pandas commando,这一次它将 pandas 安装到您的虚拟环境中,而不是您的全局 python 环境中。

Installing packages from Notebook running this cell:从运行此单元的笔记本安装包:

! pip install --user numpy
! pip install --user pandas

changing the kernel reselecting Python3 in Kernel -> Change kernel and restarting it, the problem was fixed!更改 kernel 在 Kernel 中重新选择Kernel -> Change kernel并重新启动它,问题已解决!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 (Jupyter Notebook) ModuleNotFoundError: No module named 'pandas' - (Jupyter Notebook) ModuleNotFoundError: No module named 'pandas' ModuleNotFoundError:没有名为“pandas”的模块(jupyter notebook) - ModuleNotFoundError: No module named 'pandas' (jupyter notebook) ModuleNotFoundError:没有名为“pandas”的模块 - Jupyter - ModuleNotFoundError: No module named 'pandas' - Jupyter Jupyter Notebook ModuleNotFoundError->没有名为'sql'的模块 - Jupyter Notebook ModuleNotFoundError --> No module named 'sql' ModuleNotFoundError:Jupyter Notebook 上没有名为“_tkinter”的模块 - ModuleNotFoundError: No module named '_tkinter' on Jupyter Notebook ModuleNotFoundError:在jupyter笔记本python中没有名为“可视化”的模块 - ModuleNotFoundError: No module named 'visualization' in jupyter notebook python Jupyter 笔记本:ModuleNotFoundError:没有名为“scipy”的模块 - Jupyter notebook: ModuleNotFoundError: No module named 'scipy' ModuleNotFoundError:Jupyter Notebook 中没有名为“tensorflow”的模块 - ModuleNotFoundError: No module named 'tensorflow' In Jupyter Notebook 进入 Jupyter 笔记本:ModuleNotFoundError:没有名为“podman”的模块 - Getting in Jupyter notebook: ModuleNotFoundError: No module named 'podman' ModuleNotFoundError:jupyter 笔记本中没有名为“deeppavlov”的模块 - ModuleNotFoundError: No module named 'deeppavlov' in jupyter notebook
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM