From 4d25810b4250ba8633bc630650563be931c34733 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Fri, 14 Apr 2023 11:44:48 -0700 Subject: [PATCH 1/3] Fixed import error message --- pandas/__init__.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pandas/__init__.py b/pandas/__init__.py index 1a549c09d22f7..dad695af246a3 100644 --- a/pandas/__init__.py +++ b/pandas/__init__.py @@ -18,11 +18,9 @@ ) del _hard_dependencies, _dependency, _missing_dependencies -# numpy compat -from pandas.compat import is_numpy_dev as _is_numpy_dev # pyright: ignore # noqa:F401 - try: - from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib + # numpy compat + pass # pyright: ignore # noqa:F401 except ImportError as _err: # pragma: no cover _module = _err.name raise ImportError( @@ -30,8 +28,6 @@ "pandas from the source directory, you may need to run " "'python setup.py build_ext --force' to build the C extensions first." ) from _err -else: - del _tslib, _lib, _hashtable from pandas._config import ( get_option, From d209d18a2479c05d633faa9c2c73d7681e66768c Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Fri, 14 Apr 2023 11:51:03 -0700 Subject: [PATCH 2/3] fix removal??? --- pandas/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandas/__init__.py b/pandas/__init__.py index dad695af246a3..3837ab0135939 100644 --- a/pandas/__init__.py +++ b/pandas/__init__.py @@ -20,7 +20,9 @@ try: # numpy compat - pass # pyright: ignore # noqa:F401 + from pandas.compat import ( + is_numpy_dev as _is_numpy_dev, # pyright: ignore # noqa:F401 + ) except ImportError as _err: # pragma: no cover _module = _err.name raise ImportError( From 0469b887bca346a96ce5378119d0ea845eafb15a Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Fri, 14 Apr 2023 12:36:53 -0700 Subject: [PATCH 3/3] Removed --force flag --- pandas/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/__init__.py b/pandas/__init__.py index 3837ab0135939..6ddfbadcf91d1 100644 --- a/pandas/__init__.py +++ b/pandas/__init__.py @@ -28,7 +28,7 @@ raise ImportError( f"C extension: {_module} not built. If you want to import " "pandas from the source directory, you may need to run " - "'python setup.py build_ext --force' to build the C extensions first." + "'python setup.py build_ext' to build the C extensions first." ) from _err from pandas._config import (