Python 导入错误:matplotlib 需要 dateutil

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18280436/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 10:22:33  来源:igfitidea点击:

ImportError: matplotlib requires dateutil

pythonmatplotlibpython-dateutil

提问by user2690469

I have successfully installed matplotlib with python 2.6 on x64 Windows7. When I try to import matplotlib, it shows the following error. I have also installed numpy following this link: Installing Numpy on 64bit Windows 7 with Python 2.7.3

我已经在 x64 Windows7 上成功安装了带有 python 2.6 的 matplotlib。当我尝试导入 matplotlib 时,它显示以下错误。我还通过以下链接安装了 numpy:Installing Numpy on 64bit Windows 7 with Python 2.7.3

import matplotlib.pyplot as plt

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    import matplotlib.pyplot as plt
  File "C:\Python26\Lib\site-packages\matplotlib\__init__.py", line 110, in <module>
    raise ImportError("matplotlib requires dateutil")
ImportError: matplotlib requires dateutil

How can I make it work?

我怎样才能让它工作?

I installed matplotlib-1.3.0.win-amd64-py2.6.exe from http://matplotlib.org/downloads.html

我从http://matplotlib.org/downloads.html安装了 matplotlib-1.3.0.win-amd64-py2.6.exe

采纳答案by takrliu

Here's a list of the programs you can install on windows:

以下是您可以在 Windows 上安装的程序列表:

http://www.lfd.uci.edu/~gohlke/pythonlibs/

http://www.lfd.uci.edu/~gohlke/pythonlibs/

And you'll need the following dependencies: Requires numpy, dateutil, pytz, pyparsing, six

您将需要以下依赖项:需要 numpy、dateutil、pytz、pyparsing、六个

回答by David Wolever

You're probably looking for:

您可能正在寻找:

pip install python-dateutil