简体   繁体   English

导入 matplotlib.pyplot 作为 plt

[英]import matplotlib.pyplot as plt

i have python 3.2.3 on windows.我在 Windows 上有 python 3.2.3。 installed matplotlib安装 matplotlib

i'm trying to do this:我正在尝试这样做:

import matplotlib.pyplot as plt

i get this:我明白了:

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

any idea?任何的想法?

You need to install urllib.您需要安装 urllib。 This is required by matplotlib这是 matplotlib 所要求的

Look Install urllib from : https://pypi.python.org/pypi/urllib2_file/0.2.1看从: https : urllib安装urllib

Or if you was instaled pip you can use sudo pip install urllib或者,如果您sudo pip install urllib pip ,则可以使用sudo pip install urllib

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM