File tree 1 file changed +7
-11
lines changed
1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change 4
4
__docformat__ = 'restructuredtext'
5
5
6
6
try :
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 ))
18
14
19
15
from datetime import datetime
20
16
import numpy as np
You can’t perform that action at this time.
0 commit comments