From 77148434ade857b08f7eca728e550b21509d811f Mon Sep 17 00:00:00 2001 From: Ben Steffensmeier Date: Mon, 16 Sep 2024 18:43:25 -0500 Subject: [PATCH] Update include path for compatibility with numpy 2. --- setup.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 1960728d..29389685 100755 --- a/setup.py +++ b/setup.py @@ -29,11 +29,18 @@ numpy_found = 0 try: import numpy - include_path = os.path.join(numpy.__path__[0], 'core', 'include') - if os.path.exists(include_path): - print('numpy include found at', include_path) + numpy1_include_path = os.path.join(numpy.__path__[0], 'core', 'include') + numpy2_include_path = os.path.join(numpy.__path__[0], '_core', 'include') + if os.path.exists(numpy1_include_path): + print('numpy include found at', numpy1_include_path) numpy_found = 1 - numpy_include = [include_path] + numpy_include = [numpy1_include_path] + elif os.path.exists(numpy2_include_path): + print('numpy include found at', numpy2_include_path) + numpy_found = 1 + numpy_include = [numpy2_include_path] + else: + print('numpy include not found') except ImportError: print('numpy not found, running without numpy support')