本文整理汇总了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())