File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change 44__docformat__ = 'restructuredtext'
55
66try :
7- from . import hashtable , tslib , lib
8- except Exception : # pragma: no cover
9- import sys
10- e = sys .exc_info ()[1 ] # Py25 and Py3 current exception syntax conflict
11- print (e )
12- if 'No module named lib' in str (e ):
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
7+ from pandas import hashtable , tslib , lib
8+ except ImportError as e : # pragma: no cover
9+ module = str (e ).lstrip ('cannot import name ' ) # hack but overkill to use re
10+ raise ImportError ("C extension: {0} not built. If you want to import "
11+ "pandas from the source directory, you may need to run "
12+ "'python setup.py build_ext --inplace' to build the C "
13+ "extensions first." .format (module ))
1814
1915from datetime import datetime
2016import numpy as np
You can’t perform that action at this time.
0 commit comments