这是一个类似于我以前问过的问题,但我不明白发生了什么。我正在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.
您的错误表明键入错误,matplotlib中没有模块
pylot
您拥有的导入:
import matplotlib.pylot as plt
应该是:
import matplotlib.pyplot as plt
如果有多个python安装,则使用pipVersion.exe(如pip3.7.exe)安装
matplotlib
。在linux中还有一件事,在shebang中添加解释器的完整路径相关问题 更多 >
编程相关推荐