Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

sugercoder

  • 2 years ago

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!

  • This Question is Open
  1. sugercoder
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  2. rsmith6559
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    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?

  3. sugercoder
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    They are all in the folder Python27\Lib\site-packages.

  4. rsmith6559
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    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?

  5. sugercoder
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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?

  6. Kainui
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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

  7. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy