I got this error, whan running python setup.py install for pyrosm-0.6.0.
Compiling pyrosm/_arrays.pyx because it depends on /usr/lib/python3.8/site-packages/Cython/Includes/libc/string.pxd.
Compiling pyrosm/data_filter.pyx because it depends on /usr/lib/python3.8/site-packages/Cython/Includes/libc/string.pxd.
Compiling pyrosm/pbfreader.pyx because it depends on /usr/lib/python3.8/site-packages/Cython/Includes/libc/string.pxd.
[1/3] Cythonizing pyrosm/_arrays.pyx
[2/3] Cythonizing pyrosm/data_filter.pyxError compiling Cython file:
…
import numpy as np
from cykhash.khashsets cimport Int64Set_from_buffer
^pyrosm/data_filter.pyx:2:0: ‘cykhash/khashsets.pxd’ not found
Error compiling Cython file:
…
import numpy as np
from cykhash.khashsets cimport Int64Set_from_buffer
^pyrosm/data_filter.pyx:2:0: ‘cykhash/khashsets/Int64Set_from_buffer.pxd’ not found
Error compiling Cython file:
…
cdef filter_array_dict_by_indices_or_mask(array_dict, indices):
return {k: v[indices] for k, v in array_dict.items()}cdef get_lookup_khash_for_int64(int64_id_array):
return Int64Set_from_buffer(
^pyrosm/data_filter.pyx:186:11: ‘Int64Set_from_buffer’ is not a constant, variable or function identifier
Error compiling Cython file:
…
Creates a (boolean) mask for the given source array flagging True
all items that exist in the ‘osm_ids’ array. Can be used to filter items
e.g. from OSM node data arrays.
“”"
n = len(src_array)
lookup = Int64Set_from_buffer(osm_ids)
^pyrosm/data_filter.pyx:215:13: ‘Int64Set_from_buffer’ is not a constant, variable or function identifier
Traceback (most recent call last):
File “setup.py”, line 79, in
ext_modules=cythonize(os.path.join(“pyrosm”, “*.pyx”),
File “/usr/lib/python3.8/site-packages/Cython/Build/Dependencies.py”, line 110
2, in cythonize
cythonize_one(*args)
File “/usr/lib/python3.8/site-packages/Cython/Build/Dependencies.py”, line 1225, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: pyrosm/data_filter.pyx
cykhash.khashsets is in the path “C:\cygwin64\tmp\pip-req-build-t6rr0n8h\src\cykhash”. I’m using Cygwin to build with Python3.8 on a Windows system.
I tried…
from cygdrive.c.tmp.pip-req-build-t6rr0n8h.src.cykhash.khashsets import Int64Set_from_buffer
…but got a Syntax error.
I tried moving the cykhash folder to the tmp folder to avoid the possibility that the dashes in the other folder name might be presenting a problrm, and used…
from cygdrive.c.tmp.cykhash.khashsets import Int64Set_from_buffer
… but got
No module named ‘cygdrive’
What can I do to resolve the problem?