当前位置: 首页>>代码示例>>Python>>正文


Python numpy.get_numpy_include方法代码示例

本文整理汇总了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 
开发者ID:TAMU-VITA,项目名称:ABD-Net,代码行数:8,代码来源:setup.py

示例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 
开发者ID:holgern,项目名称:pyedflib,代码行数:35,代码来源:setup.py


注:本文中的numpy.get_numpy_include方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。