Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 8209be8

Browse files
author
Matthias Koeppe
committed
Merge #31333
2 parents 7cc764a + 4550eb6 commit 8209be8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/sage/env.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -378,14 +378,18 @@ def sage_include_directories(use_sources=False):
378378
sage: any(os.path.isfile(os.path.join(d, file)) for d in dirs)
379379
True
380380
"""
381-
import numpy
382381
import distutils.sysconfig
383382

384383
TOP = SAGE_SRC if use_sources else SAGE_LIB
385384

386-
return [TOP,
387-
distutils.sysconfig.get_python_inc(),
388-
numpy.get_include()]
385+
dirs = [TOP,
386+
distutils.sysconfig.get_python_inc()]
387+
try:
388+
import numpy
389+
dirs.append(numpy.get_include())
390+
except ModuleNotFoundError:
391+
pass
392+
return dirs
389393

390394
def get_cblas_pc_module_name() -> str:
391395
"""

0 commit comments

Comments
 (0)