[pypy-issue] Issue #2631: numpy.array on pypy (pypy/pypy)

GSPark issues-reply at bitbucket.org
Sun Aug 13 10:01:19 EDT 2017


New issue 2631: numpy.array on pypy
https://bitbucket.org/pypy/pypy/issues/2631/numpyarray-on-pypy

GSPark:

I installed pypy(python2.7) and tried to run it by creating the example below.
(I need matrix calculation)

However, When building from source, I met an error.
" $ python ~/pypy/rpython/bin/rpython test.py "

I asked you because I can not solve it for a few hours.
If i enter "$ sudo pypy -c 'import numpy' ", no error will occur.

--------------------------------------------------------------------------------
[translation:ERROR] AnnotatorError: 

object with a __call__ is not RPython: <built-in function array>
Processing block:
 block at 3[args_0] is a <class 'rpython.flowspace.flowcontext.SpamBlock'> 
 in (test:3)main 
 containing the following operations: 
       v2 = simple_call((function rpython_print_item), ('Hello World')) 
       v3 = simple_call((function rpython_print_newline)) 
       v4 = newlist((1), (2)) 
       v5 = newlist((3), (4)) 
       v6 = newlist((5), (6)) 
       a_0 = newlist(v4, v5, v6) 
       b_0 = simple_call((builtin_function_or_method array), a_0) 
       v7 = getattr(b_0, ('T')) 
       c_0 = simple_call((builtin_function_or_method dot), a_0, v7) 
       v8 = str(c_0) 
       v9 = str(v8) 
       v10 = simple_call((function rpython_print_item), v9) 
       v11 = simple_call((function rpython_print_newline)) 
 --end--
[translation] start debugger...
> /home/nvidia/pypy/rpython/annotator/bookkeeper.py(404)getdesc()
-> raise AnnotatorError("%s: %r" % (msg, pyobj))
(Pdb+) 
--------------------------------------------------------------------------------
< test.py >
import numpy as np
def main(args):
	print "Hello World"
	a = [[1,2],[3,4],[5,6]]
	b = np.array(a)
	c = np.dot(a,b.T)
	print(str(c))
	return 0
def target(*args):
	return main, None




More information about the pypy-issue mailing list