Skip to content

Conversation

codeape2
Copy link

@codeape2 codeape2 commented Sep 6, 2012

Removed try/except around import pandas.lib

The try/except hid a dateutil import error.

Removed try/except around import pandas.lib

The try/except hid a dateutil import error.
@mrjbq7
Copy link

mrjbq7 commented Sep 6, 2012

Wouldn't it be better to have the current exception? Perhaps you can check for whether the ImportError came from pandas or not...

@codeape2
Copy link
Author

codeape2 commented Sep 7, 2012

IMO, it is better to not have any special handing of this import error, since the except block can raise an error with wrong information.

In my case, I didn't have python-dateutils in my virtual env. When doing "import pandas" I got the "C extensions not built" error, instead of "ImportError: No module named dateutil".

@wesm
Copy link
Member

wesm commented Sep 7, 2012

I agree it would be preferable to have a better error message. Even checking explicitly for the presence of the .so/.pyd files (to determine whether the extensions have been built) would be better.

@wesm wesm closed this in a73fb1f Sep 8, 2012
@wesm
Copy link
Member

wesm commented Sep 8, 2012

I added a narrower check that will make dateutil import failures pass through, but still get a more helpful error message if the C extension isn't built at all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants