Numba : 'Module' object has no attribute 'global_variables'
Question: This is a basic example of numba

    
    
    import numpy as np
    from numba import double
    from numba.decorators import jit, autojit
    
    X = np.random.random((1000, 3))
    
    def pairwise_python(X):
        M = X.shape[0]
        N = X.shape[1]
        D = np.empty((M, M), dtype=np.float)
        for i in range(M):
            for j in range(M):
                d = 0.0
                for k in range(N):
                    tmp = X[i, k] - X[j, k]
                    d += tmp*tmp
                D[i, j] = np.sqrt(d)
        return D
    
    pairwise_numba = autojit(pairwise_python)
    
    pairwise_numba(X)
    

But it generate the error message

    
    
    AttributeError: Failed at object (object mode frontend)
    Failed at object (object mode backend)
    'Module' object has no attribute 'global_variables'
    

My conda version is

    
    
    numba                     0.18.2               np19py27_1
    numbapro                  0.18.0              np19py27_p2
    llvmlite                  0.4.0                    py27_0
    

Do you have a same problem? Help me..


Answer: It's complicated. This is my solution.

    
    
    $ sudo apt-get install llvm-3.5-dev
    $ sudo apt-get install libedit-dev
    $ pip install enum34
    
    $ git clone https://github.com/numba/llvmlite
    $ cd llvmlite
    $ LLVM_CONFIG=/usr/bin/llvm-config-3.5 python setup.py install
    
    
    $ conda install numba
    Fetching package metadata: ....
    Solving package specifications: .
    Package plan for installation in environment /home/khkim/anaconda/envs/test:
    
    The following packages will be UPDATED:
    
        numba:    0.17.0-np19py27_0 --> 0.18.2-np19py27_1
    
    The following packages will be DOWNGRADED:
    
        llvmlite: 0.5.0-py27_0      --> 0.4.0-py27_0
    

And the code work well.

