ImportError:没有名为Cython调试器?

2024-05-19 09:47:49 发布

您现在位置:Python中文网/ 问答频道 /正文

我在windows10上调试cython代码use cygdb时遇到了这个错误。这是细节。有人能帮我吗?你知道吗

你知道吗类似.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)

你知道吗设置.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))

你知道吗测试.py你知道吗

import resemble

r = resemble.resemble("dfefgeg,fre", "wff.fefre")
print(r)

命令

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

Tags: inimportlencountintpyxs2item1

热门问题