我收到此错误,当我调试cython代码时,在Windows10上使用cygdb。这是细节。谁能帮我吗?
resemble.pyx
cdef int _resemble(str s1, str s2):
cdef int count = 0
cdef int len_s1 = len(s1)
cdef int len_s2 = len(s2)
cdef float bound = 0.5*(max(len_s1, len_s2))
cdef int index1, index2
cdef str item1, item2
for index1 in range(len_s1):
item1 = s1[index1]
for index2 in range(len_s2):
item2 = s2[index2]
if item1 == item2 and abs(index2 - index1) < bound:
count += 1
return count
def resemble(s1, s2):
return _resemble(s1, s2)
setup.py
from distutils.core import setup
from Cython.Build import cythonize
from distutils.extension import Extension
extensions = (Extension('resemble', ["resemble.pyx"]))
setup(ext_modules=cythonize(extensions, gdb_debug=True))
test.py
import resemble
r = resemble.resemble("dfefgeg,fre", "wff.fefre")
print(r)
cmd
cython --gdb resemble.pyx
python setup.py build_ext --inplace
cygdb
错误:
Traceback (most recent call last):
File "<string>", line 11, in <module>
ImportError: No module named Cython.Debugger