本文整理汇总了Python中numpy.get_numpy_include方法的典型用法代码示例。如果您正苦于以下问题:Python numpy.get_numpy_include方法的具体用法?Python numpy.get_numpy_include怎么用?Python numpy.get_numpy_include使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类numpy
的用法示例。
在下文中一共展示了numpy.get_numpy_include方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: numpy_include
# 需要导入模块: import numpy [as 别名]
# 或者: from numpy import get_numpy_include [as 别名]
def numpy_include():
try:
numpy_include = np.get_include()
except AttributeError:
numpy_include = np.get_numpy_include()
return numpy_include
示例2: get_numpy_include
# 需要导入模块: import numpy [as 别名]
# 或者: from numpy import get_numpy_include [as 别名]
def get_numpy_include():
try:
# Obtain the numpy include directory. This logic works across numpy
# versions.
# setuptools forgets to unset numpy's setup flag and we get a crippled
# version of it unless we do it ourselves.
try:
import __builtin__ # py2
__builtin__.__NUMPY_SETUP__ = False
except:
import builtins # py3
builtins.__NUMPY_SETUP__ = False
import numpy as np
except ImportError as e:
try:
# Try to install numpy
from setuptools import dist
dist.Distribution().fetch_build_eggs([REQUIRED_NUMPY])
import numpy as np
except Exception as e:
print(e)
print('*** package "numpy" not found ***')
print('pyEDFlib requires a version of NumPy, even for setup.')
print('Please get it from http://numpy.scipy.org/ or install it through '
'your package manager.')
sys.exit(-1)
try:
numpy_include = np.get_include()
except AttributeError:
numpy_include = np.get_numpy_include()
return numpy_include
# Return the git revision as a string