Question

I wrote a python script over the summer that uses NumPy and Pandas to help me code some corpus data for the linguistics/psych lab I work in. All was fine until I upgraded to OSX Mavericks -- since then the script throws the following ImportError:

No module named dateutil.parser
Traceback (most recent call last):
File "/Users/nicholasmoores/Documents/Research/DataFrame_by_child1.9.2.py", line 30, in <module>
import pandas as pd #you will have to go through the potentially arduous process
File "/Library/Python/2.7/site-packages/pandas-0.11.0-py2.7-macosx-10.8-intel.egg/pandas/__init__.py", line 6, in <module>
from . import hashtable, tslib, lib
File "tslib.pyx", line 31, in init pandas.tslib (pandas/tslib.c:48027)
ImportError: No module named dateutil.parser
logout

which is quite frustrating! I don't know why anything else on the script would fail to work after dealing with my imports, and numpy and pandas were the only ones I was expecting to have trouble with after upgrading... FYI I'm now running Python 2.7.6

import os.path
import re
import sys
import nltk
import pickle
import numpy as np
import pandas as pd
from nltk.corpus.reader import CHILDESCorpusReader
from nltk.probability import ConditionalFreqDist, FreqDist
fd = FreqDist()
cfd = ConditionalFreqDist()

I'm sure it has to do with OSX's inhouse python getting upgraded and I suppose Pandas is trying to look for python syntax in the dateutil module that has since changed or something like that. If anyone has any suggestions they would be much appreciated as I was hoping to get a lot of data coded over the holidays!

Was it helpful?

Solution

Dateutil is a dependency of pandas, it looks like somehow this module is no longer on your system.
You'll need to (re)install dateutil:

sudo pip install dateutil

OTHER TIPS

What ended up fixing the problem was redownloading and reinstalling dateutil. I'm still not completely sure where the fault was that caused Pandas to not be able to access it anymore, but I'm glad I got it all working again!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top