3

using Python33 on Windows 8.1 with Cuda toolkit 5.5 and hardware installed when trying to import and initialize the device with:

import pycuda.driver as cuda
import pycuda.autoinit
from pycuda.compiler import SourceModule   <--- this line causes the error

I get the below error:

Traceback (most recent call last):
File "C:\Python33\Lib\site-packages\pytools\datatable.py", line 1, in <module>
from pytools import Record
File "C:\Python33\lib\site-packages\pytools\__init__.py", line 1249
print value, bin_nr, bin_starts
          ^
SyntaxError: invalid syntax

Can anyone advise on this or suggest a work around?

Smithma01
  • 31
  • 1
  • You're using Python 3.x, but from the error, `pytools` seems to contain a Python 2.x-style `print` statement. How did you install `pycuda` and/or `pytools`? – George Bahij Mar 31 '14 at 07:33
  • 1
    As mentioned above the `print` statement for Python3.x should look like `print(value, bin_nr, bin_starts)` It seems that you installed pycuda for Python2.x – ilciavo Oct 16 '14 at 14:46

1 Answers1

0

This appears to have been caused by attempting to use a version of PyCUDA without Python 3 support in Python 3.

Python 3 support was officially added in PyCUDA 2013.1

talonmies
  • 70,661
  • 34
  • 192
  • 269