numba / numba

NumPy aware dynamic Python compiler using LLVM
https://numba.pydata.org/
BSD 2-Clause "Simplified" License
9.79k stars 1.11k forks source link

Error: 'Module' object has no attribute 'global_variables' #1002

Closed david-zwicker closed 9 years ago

david-zwicker commented 9 years ago

I upgrade to the latest numba (0.17.0) using macports on mac osx 10.10.02 and now I cannot compile any numba functions anymore. Compilation fails with the following error:

Python 2.7.9 (default, Dec 13 2014, 15:13:49) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import number
>>> numba.__version__
'0.17.0'
>>> @numba.jit
... def f(x):
...     return x
... 
>>> f(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numba/dispatcher.py", line 157, in _compile_for_args
    return self.compile(sig)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numba/dispatcher.py", line 277, in compile
    flags=flags, locals=self.locals)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numba/compiler.py", line 547, in compile_extra
    return pipeline.compile_extra(func)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numba/compiler.py", line 293, in compile_extra
    return self.compile_bytecode(bc, func_attr=self.func_attr)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numba/compiler.py", line 301, in compile_bytecode
    return self._compile_bytecode()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numba/compiler.py", line 534, in _compile_bytecode
    return pm.run(self.status)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numba/compiler.py", line 191, in run
    raise patched_exception
AttributeError: Failed at object (object mode backend)
'Module' object has no attribute 'global_variables'
>>> 

The same setup worked with numba version 0.16. Let me know if you need further information about my setup.

gmarkall commented 9 years ago

This looks like llvmlite needs updating. Running conda update llvmlite should resolve the issue.

david-zwicker commented 9 years ago

Well, the problem was actually that I needed to downgrade llvmlite. My macports already installed llvmlite 0.3.0, which is apparently incompatible with numba 0.17.0 (which is also installed via macports). One could argue that this is a problem with macports, but on the other hand a more useful error message on numbas site would also help. Anyhow, I now have a running numba installation again.

David

On 20. Feb 2015, at 05:01 , Graham Markall notifications@github.com wrote:

This looks like llvmlite needs updating. Running conda update llvmlite should resolve the issue.

— Reply to this email directly or view it on GitHub.

Dr. David Zwicker School of Engineering and Applied Science Harvard University 29 Oxford Street, Cambridge MA 02139 http://www.david-zwicker.de

seibert commented 9 years ago

We haven't officially released llvmlite 0.3.0 (although it is tagged, so I can see how the macports package maintainer might have assumed it was released), which contains a method name change that requires a corresponding change in numba.