Hi guys,
I’m working on a fairly long code that is compiling correctly, but giving an error when it runs.
I’m working on Windows 64 bits, Python 2.7 (last installer made available) and the last versions of the installers for Numpy/Scipy/Cython made by Chris Gohlke.
Thanks for the help,
Pedro
The error is:
File "Assignment2.pyx", line 493, in Assignment._Ordering_and_Forward_Star (Assignment2.c:6242)
cdef _Ordering_and_Forward_Star(np.ndarray[ITYPE_t, ndim=2, mode='c'] graph, #A_Node/B_Node
ValueError: Buffer dtype mismatch, expected 'ITYPE_t' but got 'long long'
It points to this header:
cdef _Ordering_and_Forward_Star(np.ndarray[ITYPE_t, ndim=2, mode='c'] graph, #A_Node/B_Node
np.ndarray[ITYPE_t, ndim=2, mode='c'] g_aux,
np.ndarray[DTYPE_t, ndim=2, mode='c'] graph_data,
np.ndarray[DTYPE_t, ndim=2, mode='c'] g_aux2,
np.ndarray[ITYPE_t, ndim=1, mode='c'] ind,
np.ndarray[ITYPE_t, ndim=1, mode='c'] graph_fs):
And the matrices are dimensioned and the function called this way:
graph=np.zeros((l,2), dtype=ITYPE) #Holds node of origin and node of destination
graph_fs=np.zeros(nodes+1, dtype=ITYPE) #Holds the Forward star for the graph
graph_data=np.zeros((l,2), dtype=DTYPE) #Holds data for the graph. First column is the nested utility and the second the utility used for Shortest path
…
g_aux=graph.copy() #to sort the indices
g_aux2=graph_data.copy()
_Ordering_and_Forward_Star(graph,
g_aux,
graph_data,
g_aux2,
ind,
graph_fs)
Searching the problem I saw references to a problem of 32 Vs. 64 bits, but when I tried with 32 bits I get this:
C:\Users\Pedro\Desktop\Paths test>c:\Python27\python setup_Assignment.py build_e
xt --inplace
running build_ext
skipping 'Assignment2.c' Cython extension (up-to-date)
building 'Assignment' extension
Traceback (most recent call last):
File "setup_Assignment.py", line 23, in <module>
include_dirs=[np.get_include()])
File "c:\Python27\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "c:\Python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "c:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "c:\Python27\lib\site-packages\Cython\Distutils\build_ext.py", line 163,
in run
_build_ext.build_ext.run(self)
File "c:\Python27\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "c:\Python27\lib\site-packages\Cython\Distutils\build_ext.py", line 171,
in build_extensions
self.build_extension(ext)
File "c:\Python27\lib\distutils\command\build_ext.py", line 498, in build_exte
nsion
depends=ext.depends)
File "c:\Python27\lib\distutils\msvc9compiler.py", line 473, in compile
self.initialize()
File "c:\Python27\lib\distutils\msvc9compiler.py", line 383, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "c:\Python27\lib\distutils\msvc9compiler.py", line 299, in query_vcvarsal
l
raise ValueError(str(list(result.keys())))
ValueError: [u'path']
C:\Users\Pedro\Desktop\Paths test>
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users+unsubscribe <at> googlegroups.com.