10
votes

I installed Python-Dateutil package, but when i import it in my script , it's throwing error:

import dateutil ImportError: No module named 'dateutil'

when i checked the lib folder, dateutil.eggs files are there , because of this i can not run matplotlib module. Please provide a solution.

3
Whether or not you have some eggs is not important. Is the package installed? How did you install it? - ImportanceOfBeingErnest
I downloaded the source file and in command prompt gave the command as: "python setup.py install. " - Abhinaba
This is the prompt :-----C:\.................\Python\Python35-32\Scripts\dateutil-2.3>python setup.py install... please tell me if anything is wrong.@ImportanceOfBeingErnest - Abhinaba
That should be fine. Do you have a Lib\site-packages\dateutil folder? Usually you do not need to install it manually though, pip install dateutil or similar. - ImportanceOfBeingErnest
No I can't do that, because my system is running behind firewall. It can't download dateutil on its own. I have to install it manually. And no there is no dateutil folder inside the the path you given. Only .egg file of dateutil is there. if you want i can share the cmd prompt after the installation is done. - Abhinaba

3 Answers

10
votes

Python 3+

pip3 install python-dateutil

Python 2

pip install python-dateutil
1
votes

if you are using the anaconda

open anaconda prompt (go to start and search anaconda prompt)
type the following command on prompt

conda install -c anaconda dateutil

if you are using python 3.x version

pip3 install python-dateutil

if you are using python 2 version

pip2 install python-dateutil

0
votes

do you have multiple python version on your computer ? python 2.7 and 3.5 for example. maybe there is a confusion here.

or even multiple version of python 3.5 ?

i often have this problem when I forget which python I am using.