本文整理匯總了Python中builtins.__NUMPY_SETUP__屬性的典型用法代碼示例。如果您正苦於以下問題:Python builtins.__NUMPY_SETUP__屬性的具體用法?Python builtins.__NUMPY_SETUP__怎麽用?Python builtins.__NUMPY_SETUP__使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類builtins
的用法示例。
在下文中一共展示了builtins.__NUMPY_SETUP__屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: finalize_options
# 需要導入模塊: import builtins [as 別名]
# 或者: from builtins import __NUMPY_SETUP__ [as 別名]
def finalize_options(self):
_build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
try:
__builtins__.__NUMPY_SETUP__ = False
except:
try:
# For python 3
import builtins
builtins.__NUMPY_SETUP__ = False
except:
warn("Skipping numpy hack; if installation fails, try installing numpy first")
import numpy
self.include_dirs.append(numpy.get_include())
if numpy.__dict__.get('quaternion') is not None:
from distutils.errors import DistutilsError
raise DistutilsError('The target NumPy already has a quaternion type')
示例2: include_dirs_hook
# 需要導入模塊: import builtins [as 別名]
# 或者: from builtins import __NUMPY_SETUP__ [as 別名]
def include_dirs_hook():
if hasattr(builtins, '__NUMPY_SETUP__'):
del builtins.__NUMPY_SETUP__
import numpy
importlib.reload(numpy)
ext = Extension('test', [])
# ext.include_dirs.append(numpy.get_include())
#iOS:
ext.include_dirs.append('../../onIpad/lib/python3.7/site-packages/numpy-1.16.0-py3.7-macosx-10.9-x86_64.egg/numpy/core/include/')
print("Include dirs found: ", numpy.get_include())
if not has_include_file(
ext.include_dirs, os.path.join("numpy", "arrayobject.h")):
warnings.warn(
"The C headers for numpy could not be found. "
"You may need to install the development package")
#iOS:
return ['../../onIpad/lib/python3.7/site-packages/numpy-1.16.0-py3.7-macosx-10.9-x86_64.egg/numpy/core/include/']
# return [numpy.get_include()]
示例3: is_bootstrapping
# 需要導入模塊: import builtins [as 別名]
# 或者: from builtins import __NUMPY_SETUP__ [as 別名]
def is_bootstrapping():
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin__ as builtins
try:
builtins.__NUMPY_SETUP__
return True
except AttributeError:
return False
#########################
示例4: is_bootstrapping
# 需要導入模塊: import builtins [as 別名]
# 或者: from builtins import __NUMPY_SETUP__ [as 別名]
def is_bootstrapping():
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin__ as builtins
try:
builtins.__NUMPY_SETUP__
return True
except AttributeError:
return False
__NUMPY_SETUP__ = False
#########################
示例5: finalize_options
# 需要導入模塊: import builtins [as 別名]
# 或者: from builtins import __NUMPY_SETUP__ [as 別名]
def finalize_options(self):
build_ext.finalize_options(self)
import builtins
# Prevent numpy from thinking it is still in its setup process:
builtins.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())