I installed matplotlib (1.3.1) and dateutil (1.5) into python site package folder. My python is 2.7.6. My computer is Win 7/64-bit. When I try to run: from matplotlib.pylab import * It still gives me error message "ImportError: No module named dateutil" How can I fix this? Thanks!
The entire error message is this: Traceback (most recent call last): File "C:\Python27\Courses\MIT 6.00 Intruduction to CS and Python\lec14.py", line 4, in <module> import matplotlib File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 111, in <module> raise ImportError("matplotlib requires dateutil") ImportError: matplotlib requires dateutil It looks like the matplotlib could not call the dateutil module also, I googled it and could not find a satisfactory answer. It is much appreciated if you can help me.
Generally, when you call a file with only it's name, it needs to be in the same directory that you're in. If I remember correctly, Python has an environmental variable MODULEPATH which is a list of directories to look for modules when they're called without a path. Basically, where is dateutil and where is matplotlib in the file system?
They are all in the folder Python27\Lib\site-packages.
Next thing to check would be to look at C:\Python27\lib\site-packages\matplotlib and see exactly how it's trying to import dateutil. Have you looked at the FAQ for matplotlib?
The file is C:\Python27\lib\site-packages\matplotlib\__init__.py The code which raises the problem is try: import dateutil except ImportError: raise ImportError("matplotlib requires dateutil") I installed dateutil from http://labix.org/python-dateutil#head-2f49784d6b27bae60cde1cff6a535663cf87497b So it means I did not install dateutil correctly?
If you just want to play around in python, I believe khan academy has python just sort of built in to their website, and you can even save your stuff too. https://www.khanacademy.org/cs/new
Join our real-time social learning platform and learn together with your friends!