當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。