Skip to content

Commit 8b797e9

Browse files
authored
Fixed import error message when extensions not built (#52674)
* Fixed import error message * fix removal??? * Removed --force flag
1 parent 5b525b4 commit 8b797e9

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

pandas/__init__.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,18 @@
1818
)
1919
del _hard_dependencies, _dependency, _missing_dependencies
2020

21-
# numpy compat
22-
from pandas.compat import is_numpy_dev as _is_numpy_dev # pyright: ignore # noqa:F401
23-
2421
try:
25-
from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
22+
# numpy compat
23+
from pandas.compat import (
24+
is_numpy_dev as _is_numpy_dev, # pyright: ignore # noqa:F401
25+
)
2626
except ImportError as _err: # pragma: no cover
2727
_module = _err.name
2828
raise ImportError(
2929
f"C extension: {_module} not built. If you want to import "
3030
"pandas from the source directory, you may need to run "
31-
"'python setup.py build_ext --force' to build the C extensions first."
31+
"'python setup.py build_ext' to build the C extensions first."
3232
) from _err
33-
else:
34-
del _tslib, _lib, _hashtable
3533

3634
from pandas._config import (
3735
get_option,

0 commit comments

Comments
 (0)