|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
最近在进行一个代码的学习用到了 pylab,一直出现这样的错误
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import pylab
File "D:\python\lib\site-packages\pylab.py", line 1, in <module>
from matplotlib.pylab import *
File "D:\python\lib\site-packages\matplotlib\__init__.py", line 107, in <module>
from . import _api, cbook, docstring, rcsetup
File "D:\python\lib\site-packages\matplotlib\cbook\__init__.py", line 28, in <module>
import numpy as np
File "D:\python\lib\site-packages\numpy\__init__.py", line 161, in <module>
from . import random
File "D:\python\lib\site-packages\numpy\random\__init__.py", line 180, in <module>
from . import _pickle
File "D:\python\lib\site-packages\numpy\random\_pickle.py", line 1, in <module>
from .mtrand import RandomState
ImportError: DLL load failed while importing mtrand: 找不到指定的程序。
但是我已经装了matplotlib,下面是在cmd里输入pip install matplotlib的结果
C:\Users\A>pip install matplotlib
Requirement already satisfied: matplotlib in d:\python\lib\site-packages (3.4.3)
Requirement already satisfied: numpy>=1.16 in d:\python\lib\site-packages (from matplotlib) (1.21.4)
Requirement already satisfied: kiwisolver>=1.0.1 in d:\python\lib\site-packages (from matplotlib) (1.3.2)
Requirement already satisfied: cycler>=0.10 in d:\python\lib\site-packages (from matplotlib) (0.11.0)
Requirement already satisfied: python-dateutil>=2.7 in d:\python\lib\site-packages (from matplotlib) (2.8.2)
Requirement already satisfied: pyparsing>=2.2.1 in d:\python\lib\site-packages (from matplotlib) (3.0.5)
Requirement already satisfied: pillow>=6.2.0 in d:\python\lib\site-packages (from matplotlib) (8.4.0)
Requirement already satisfied: six>=1.5 in d:\python\lib\site-packages (from python-dateutil>=2.7->matplotlib) (1.16.0)
刚接触Pyhton实在是不知道怎么解决了
本帖最后由 suchocolate 于 2021-11-14 10:35 编辑
说一下你的python版本。
pip install xxx 默认装的是最新版本,可能与你的python版本不兼容,如果python较老,安装包时选个差不多时间发布的版本,例如:pip install matplotlib==3.2.0
如果还是不行,重装python试试。
|
|