[英]ModuleNotFoundError: no module named Python Error
import numpy as np
from numpy.random import default_rng
import matplotlib.pyplot as plt
import line
from python import display
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In [12], line 3
1 import numpy as np
2 from numpy.random import default_rng
----> 3 import matplotlib.pyplot as plt
4 import line
5 from python import display
ModuleNotFoundError: No module named 'matplotlib'
import numpy as np
from numpy.random import default_rng
from python import display
import matplotlib.pyplot as plt
import line
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In [13], line 4
1 import numpy as np
2 from numpy.random import default_rng
----> 4 from python import display
5 import matplotlib.pyplot as plt
6 import line
ModuleNotFoundError: No module named 'python'
i wonna make graph...................................................................................我要制作图表...................................................... .....................................
Isn't display
part of ipython
? display
不是ipython
的一部分吗?
Could you post pip freeze
to get an overview of your installed python modules?你能发布pip freeze
来了解你安装的 python 模块吗?
ModuleNotFoundError
means there is a problem trying import a module into your application. ModuleNotFoundError
表示尝试将模块导入您的应用程序时出现问题。 Often this is because you don't have the module available locally (ie not installed).这通常是因为您没有本地可用的模块(即未安装)。 It can also be because you've mistyped the import statement or are trying to import the module using the wrong name.也可能是因为您输入错误的导入语句或尝试使用错误的名称导入模块。
In your case:在你的情况下:
from python import display
doesn't make much sense. from python import display
没有多大意义。 Python is not a package, as far as I'm aware.据我所知,Python 不是一个包。 Where did this line of code come from?这行代码是哪里来的? Where is the display()
function you are trying to use?您要使用的display()
函数在哪里?
----> 3 import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'
This means the matplotlib library is not installed.这意味着未安装 matplotlib 库。 You can install it using:您可以使用以下方式安装它:
python3 -m pip install matplotlib
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.