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


Groups > comp.lang.python > #82528 > unrolled thread

problem with six.moves intern importError

Started byjean-michel richer <jean-michel.richer@univ-angers.fr>
First post2014-12-14 07:25 +0100
Last post2014-12-14 07:25 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

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

#82528 — problem with six.moves intern importError

Fromjean-michel richer <jean-michel.richer@univ-angers.fr>
Date2014-12-14 07:25 +0100
Subjectproblem with six.moves intern importError
Message-ID<mailman.16957.1418594464.18130.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web