Skip to content

Commit

Permalink
Update include path for compatibility with numpy 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
bsteffensmeier committed Sep 22, 2024
1 parent 43a738b commit 4edfbf9
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down

0 comments on commit 4edfbf9

Please sign in to comment.