Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #82528

problem with six.moves intern importError

Date 2014-12-14 07:25 +0100
From jean-michel richer <jean-michel.richer@univ-angers.fr>
Subject problem with six.moves intern importError
Organization LERIA
Newsgroups comp.lang.python
Message-ID <mailman.16957.1418594464.18130.python-list@python.org> (permalink)

Show all headers | View raw


Hi,
   I am new to python and I am trying to use pycuda but get some
error on the following script. My environement is :

Python 2.7.6
libboost 1.54
gcc/g++ 4.8.2
CUDA 6.5

================================
import pycuda.autoinit
import pycuda.driver as drv
import numpy

from pycuda.compiler import SourceModule
mod = SourceModule("""
__global__ void multiply_them(float *dest, float *a, float *b)
{
   const int i = threadIdx.x;
   dest[i] = a[i] * b[i];
}
""")

multiply_them = mod.get_function("multiply_them")

a = numpy.random.randn(400).astype(numpy.float32)
b = numpy.random.randn(400).astype(numpy.float32)

dest = numpy.zeros_like(a)
multiply_them(
         drv.Out(dest), drv.In(a), drv.In(b),
         block=(400,1,1), grid=(1,1))

print dest-a*b
================================

when I run the script I get the followin import error:

$ python ex_pycuda.py
Traceback (most recent call last):
   File "ex_pycuda.py", line 5, in <module>
     from pycuda.compiler import SourceModule
   File 
"/usr/local/lib/python2.7/dist-packages/pycuda-2014.1-py2.7-linux-x86_64.egg/pycuda/compiler.py", 
line 1, in <module>
     from pytools import memoize
   File 
"/usr/local/lib/python2.7/dist-packages/pytools-2014.3.5-py2.7.egg/pytools/__init__.py", 
line 5, in <module>
     from six.moves import range, zip, intern, input
ImportError: cannot import name intern

Is there a workaround or is it a bug ?

Best regards,
Jean-Michel

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

problem with six.moves intern importError jean-michel richer <jean-michel.richer@univ-angers.fr> - 2014-12-14 07:25 +0100

csiph-web