def get_include():
"""
Return the directory that contains the NumPy \\*.h header files.
Extension modules that need to compile against NumPy should use this
function to locate the appropriate include directory.
Notes
-----
When using ``distutils``, for example in ``setup.py``.
::
import numpy as np
...
Extension('extension_name', ...
include_dirs=[np.get_include()])
...
"""
import cykdtree
return os.path.dirname(cykdtree.__file__)
numpy.get_include()
最新推荐文章于 2023-07-27 13:34:47 发布
此篇博客介绍了如何使用`numpy.get_include()`函数在编译扩展模块时定位NumPy包含目录,适用于依赖NumPy的Python扩展开发。通过cykdtree库的路径获取作为示例。
2231

被折叠的 条评论
为什么被折叠?



