fjarri / reikna

Pure Python GPGPU library
http://reikna.publicfields.net/
MIT License
164 stars 16 forks source link

Importing fft module fails #14

Closed matze closed 10 years ago

matze commented 10 years ago

I installed reikna via pip into a virtualenv, unfortunately importing the fft module fails with an interesting stack trace:

Python 2.7.3 (default, Sep 26 2013, 20:03:06) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import reikna
>>> import reikna.fft
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/matthias/venvs/heb/local/lib/python2.7/site-packages/reikna/fft.py", line 4, in <module>
    from reikna.core import Computation, Parameter, Annotation
  File "/home/matthias/venvs/heb/local/lib/python2.7/site-packages/reikna/core/__init__.py", line 1, in <module>
    from reikna.core.signature import Type, Annotation, Parameter, Signature
  File "/home/matthias/venvs/heb/local/lib/python2.7/site-packages/reikna/core/signature.py", line 5, in <module>
    import reikna.cluda.dtypes as dtypes
  File "/home/matthias/venvs/heb/local/lib/python2.7/site-packages/reikna/cluda/__init__.py", line 4, in <module>
    from reikna.cluda.kernel import Module, Snippet
  File "/home/matthias/venvs/heb/local/lib/python2.7/site-packages/reikna/cluda/kernel.py", line 10, in <module>
    TEMPLATE = template_for(__file__)
  File "/home/matthias/venvs/heb/local/lib/python2.7/site-packages/reikna/helpers/__init__.py", line 153, in template_for
    return make_template(name + '.mako', filename=True)
  File "/home/matthias/venvs/heb/local/lib/python2.7/site-packages/reikna/helpers/__init__.py", line 95, in make_template
    return Template(**kwds)
TypeError: __init__() got an unexpected keyword argument 'future_imports'
fjarri commented 10 years ago

future_imports is a keyword for the mako.template.Template constructor, which was added in version 0.8. setup.py should enforce mako >= 0.8; could you please check the version of mako you have (pip list | grep Mako)?

matze commented 10 years ago

Seems to be a local problem on my machine. I had a system installation of Mako in version 0.5 and pip just didn't want to upgrade Mako in the virtualenv … I removed the system Mako and it works now. Thanks for the hint!