tumultous_rooster
tumultous_rooster

Reputation: 12560

dateutil.tz package apparently missing when using Pandas?

My python 2.7 code is as follows:

import pandas as pd
from pandas import DataFrame

DF_rando = DataFrame([1,2,3])

...and then when I execute, I get a strange error regarding dateutil.tz.

/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 /Users/mattobrien/pandas_test.py
No module named dateutil.tz
Traceback (most recent call last):
  File "/Users/mattobrien/pandas_test.py", line 2, in <module>
    import pandas as pd
  File "/Library/Python/2.7/site-packages/pandas/__init__.py", line 7, in <module>
    from . import hashtable, tslib, lib
  File "pandas/tslib.pyx", line 37, in init pandas.tslib (pandas/tslib.c:76999)
ImportError: No module named dateutil.tz

Process finished with exit code 1

Very strange. I checked an indeed dateutil.tz is indeed installed. I uninstalled Pandas and reinstalled it to be sure. No issues there.

Why am I getting this error?

Upvotes: 6

Views: 15450

Answers (1)

tumultous_rooster
tumultous_rooster

Reputation: 12560

Needed these 2 lines.

sudo pip install python-dateutil --upgrade

sudo pip install pytz --upgrade

Upvotes: 20

Related Questions