[英]"ModuleNotFoundError: No module named '…' even though module is installed
[英]ModuleNotFoundError: No module named 'tabulate' even though its installed
我在 Jupyter Notebook 中并在一个单元格中运行
!pip3 install tabulate
它返回
Requirement already satisfied: tabulate in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (0.8.10)
当我跑步时
!pip3 freeze
我看到tabulate==0.8.10
。
但是,当我现在尝试通过导入tabulate
时
from tabulate import tabulate
它抛出
ModuleNotFoundError: No module named 'tabulate'
即使我重新启动 kernel 它也不起作用。
任何人都可以帮助为什么它不能导入它吗?
使用
%pip install <module-name>
而不是!pip install <module-name>
在 jupyter 笔记本单元中解决了这个问题。
这个答案来自@Wayne。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.