Python numpy.get_numpy_include() Examples

The following are 6 code examples for showing how to use numpy.get_numpy_include(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.

You may check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module numpy , or try the search function .

Example 1
Project: ABD-Net   Author: TAMU-VITA   File: setup.py    License: MIT License 5 votes vote down vote up
def numpy_include():
    try:
        numpy_include = np.get_include()
    except AttributeError:
        numpy_include = np.get_numpy_include()
    return numpy_include 
Example 2
Project: reid_baseline_with_syncbn   Author: DTennant   File: setup.py    License: MIT License 5 votes vote down vote up
def numpy_include():
    try:
        numpy_include = np.get_include()
    except AttributeError:
        numpy_include = np.get_numpy_include()
    return numpy_include 
Example 3
Project: fast-reid   Author: JDAI-CV   File: setup.py    License: Apache License 2.0 5 votes vote down vote up
def numpy_include():
    try:
        numpy_include = np.get_include()
    except AttributeError:
        numpy_include = np.get_numpy_include()
    return numpy_include 
Example 4
Project: deep-person-reid   Author: KaiyangZhou   File: setup.py    License: MIT License 5 votes vote down vote up
def numpy_include():
    try:
        numpy_include = np.get_include()
    except AttributeError:
        numpy_include = np.get_numpy_include()
    return numpy_include 
Example 5
Project: deep-person-reid   Author: KaiyangZhou   File: setup.py    License: MIT License 5 votes vote down vote up
def numpy_include():
    try:
        numpy_include = np.get_include()
    except AttributeError:
        numpy_include = np.get_numpy_include()
    return numpy_include 
Example 6
Project: pyedflib   Author: holgern   File: setup.py    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
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