gpt4 book ai didi

python - 将 matplotlib.pyplot 导入为 plt

转载 作者:行者123 更新时间:2023-11-28 19:29:35 25 4
gpt4 key购买 nike

我在 Windows 上安装了 Python 3.2.3。安装matplotlib

我正在尝试这样做:

import matplotlib.pyplot as plt

我明白了:

Traceback (most recent call last):
File "<pyshell#10>", line 1, in <module>
import matplotlib.pyplot as plt
File "E:\programs\python 3.2.3\lib\site-packages\matplotlib\pyplot.py", line 24, in <module>
import matplotlib.colorbar
File "E:\programs\python 3.2.3\lib\site-packages\matplotlib\colorbar.py", line 29, in <module>
import matplotlib.collections as collections
File "E:\programs\python 3.2.3\lib\site-packages\matplotlib\collections.py", line 23, in <module>
import matplotlib.backend_bases as backend_bases
File "E:\programs\python 3.2.3\lib\site-packages\matplotlib\backend_bases.py", line 50, in <module>
import matplotlib.textpath as textpath
File "E:\programs\python 3.2.3\lib\site-packages\matplotlib\textpath.py", line 5, in <module>
import urllib.request, urllib.parse, urllib.error
ImportError: No module named urllib.request

有什么想法吗?

最佳答案

您需要安装 urllib。这是 matplotlib 需要的

关于python - 将 matplotlib.pyplot 导入为 plt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23370715/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com