本文整理匯總了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