Skip to content

Commit 19037a6

Browse files
committed
DOC: add more helpful error message when accidentally importing pandas from source directory, address GH #250
1 parent d9ea01f commit 19037a6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66

77
import numpy as np
88

9+
try:
10+
import pandas._tseries as lib
11+
except Exception, e:
12+
if 'No module named' in e.message:
13+
raise ImportError('C extensions not built: if you installed already '
14+
'verify that you are not importing from the source '
15+
'directory')
16+
else:
17+
raise
18+
919
from pandas.version import version as __version__
1020
from pandas.info import __doc__
1121

0 commit comments

Comments
 (0)