【发布时间】:2020-10-22 01:41:49
【问题描述】:
这与我之前提出的问题类似,但我不明白发生了什么。我在 Windows 上使用 pip 20.2.3 和 python 3.8.2。
之前,当我在 cmd 中输入 pip install matplotlib 或 pip3 install matplotlib 时,我会收到一条消息,说所有“要求都已满足”。但是当我在 VSCode 上运行 import matplotlib.pylot as plt 时,它告诉我
Traceback (most recent call last):
File "c:/Users/sound/Desktop/now/Trade Simulation/#2/Trade Simulation.py", line 6, in <module>
import matplotlib.pylot as plt
ModuleNotFoundError: No module named 'matplotlib.pylot'
不仅如此,我最近刚刚将 pip 从20.2.3 更新为20.2.4。当我运行相同的命令pip install matplotlib 时,我没有像以前那样说“满足要求”,而是收到一条红色的大量错误消息,如下所示:
ERROR: Command errored out with exit status 1:
command: 'c:\users\sound\appdata\local\programs\python\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sound\\AppData\\Local\\Temp\\pip-install-9w_lvhnf\\matplotlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\sound\\AppData\\Local\\Temp\\pip-install-9w_lvhnf\\matplotlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\sound\AppData\Local\Temp\pip-pip-egg-info-ihoi_gsj'
cwd: C:\Users\sound\AppData\Local\Temp\pip-install-9w_lvhnf\matplotlib\
Complete output (249 lines):
WARNING: The wheel package is not available.
ERROR: Command errored out with exit status 1:
command: 'c:\users\sound\appdata\local\programs\python\python39\python.exe' 'c:\users\sound\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\sound\AppData\Local\Temp\tmpsqdka5ne'
当我更新 pip 时输出的变化有点让我失望。我不确定该怎么做或如何解决此安装错误。任何见解将不胜感激。
使用pip3.8 install -U matplotlib 会回复我
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'C:\\Users\\12132\\AppData\\Local\\Programs\\Python\\Python38-32\\Lib\\site-packages\\~atplotlib\\ft2font.cp38-win32.pyd'
Consider using the `--user` option or check the permissions.
【问题讨论】:
-
您的错误表明有错字:
import matplotlib.pylot as plt应该是import matplotlib.pyplot as plt
标签: python matplotlib import module