当在 linux 服务器上安装 levenshtein 时,出现以下错误:
/yuwei/anaconda3/include/python3.7m/object.h:487:22: note: in definition of macro ‘PyObject_TypeCheck’ (Py_TYPE(ob) == (tp) || PyType_IsSubtype(Py_TYPE(ob), (tp))) ^ Levenshtein.c:666:33: note: each undeclared identifier is reported only once for each function it appears in if (PyObject_TypeCheck(arg1, &PyString_Type)<br> ^ /yuwei/anaconda3/include/python3.7m/object.h:487:22: note: in definition of macro ‘PyObject_TypeCheck’ (Py_TYPE(ob) == (tp) || PyType_IsSubtype(Py_TYPE(ob), (tp))) ^ Levenshtein.c:670:5: warning: implicit declaration of function ‘PyString_GET_SIZE’ [-Wimplicit-function-declaration]<br> len1 = PyString_GET_SIZE(arg1);<br> ^ Levenshtein.c:673:5: warning: implicit declaration of function ‘PyString_AS_STRING’ [-Wimplicit-function-declaration]<br> string1 = PyString_AS_STRING(arg1);<br> ^ Levenshtein.c:673:13: warning: assignment makes pointer from integer without a cast [enabled by default]<br> string1 = PyString_AS_STRING(arg1);<br> ^ Levenshtein.c:674:13: warning: assignment makes pointer from integer without a cast [enabled by default]<br> string2 = PyString_AS_STRING(arg2);<br> ^ Levenshtein.c:718:3: warning: implicit declaration of function ‘PyInt_FromLong’ [-Wimplicit-function-declaration]<br> return PyInt_FromLong((long)ldist);<br> ^ Levenshtein.c:718:3: warning: return makes pointer from integer without a cast [enabled by default]<br> In file included from /yuwei/anaconda3/include/python3.7m/pytime.h:6:0,<br> from /yuwei/anaconda3/include/python3.7m/Python.h:87,<br> from Levenshtein.c:99:<br> Levenshtein.c: In function ‘hamming_py’:<br> Levenshtein.c:747:33: error: ‘PyString_Type’ undeclared (first use in this function)<br> if (PyObject_TypeCheck(arg1, &PyString_Type)<br> ^ /yuwei/anaconda3/include/python3.7m/object.h:487:22: note: in definition of macro ‘PyObject_TypeCheck’<br> (Py_TYPE(ob) == (tp) || PyType_IsSubtype(Py_TYPE(ob), (tp)))<br> ^ Levenshtein.c:758:13: warning: assignment makes pointer from integer without a cast [enabled by default]<br> string1 = PyString_AS_STRING(arg1);<br> ^ Levenshtein.c:759:13: warning: assignment makes pointer from integer without a cast [enabled by default]<br> string2 = PyString_AS_STRING(arg2);<br> ^ Levenshtein.c:761:5: warning: return makes pointer from integer without a cast [enabled by default]<br> return PyInt_FromLong(dist);<br> ^ Levenshtein.c:777:5: warning: return makes pointer from integer without a cast [enabled by default]<br> return PyInt_FromLong(dist);<br> ^ In file included from /yuwei/anaconda3/include/python3.7m/pytime.h:6:0,<br> from /yuwei/anaconda3/include/python3.7m/Python.h:87,<br> from Levenshtein.c:99:<br> Levenshtein.c: In function ‘jaro_py’:<br> Levenshtein.c:796:33: error: ‘PyString_Type’ undeclared (first use in this function)<br> if (PyObject_TypeCheck(arg1, &PyString_Type)<br> ^ /yuwei/anaconda3/include/python3.7m/object.h:487:22: note: in definition of macro ‘PyObject_TypeCheck’<br> (Py_TYPE(ob) == (tp) || PyType_IsSubtype(Py_TYPE(ob), (tp)))<br> ^ Levenshtein.c:802:13: warning: assignment makes pointer from integer without a cast [enabled by default]<br> string1 = PyString_AS_STRING(arg1);<br> ^ Levenshtein.c:803:13: warning: assignment makes pointer from integer without a cast [enabled by default]<br> string2 = PyString_AS_STRING(arg2);<br> ^ In file included from /yuwei/anaconda3/include/python3.7m/pytime.h:6:0,<br> from /yuwei/anaconda3/include/python3.7m/Python.h:87,<br> from Levenshtein.c:99:<br> Levenshtein.c: In function ‘jaro_winkler_py’:<br> Levenshtein.c:846:33: error: ‘PyString_Type’ undeclared (first use in this function)<br> if (PyObject_TypeCheck(arg1, &PyString_Type)<br> ^ /yuwei/anaconda3/include/python3.7m/object.h:487:22: note: in definition of macro ‘PyObject_TypeCheck’<br> (Py_TYPE(ob) == (tp) || PyType_IsSubtype(Py_TYPE(ob), (tp)))<br> ^ Levenshtein.c:852:13: warning: assignment makes pointer from integer without a cast [enabled by default]<br> string1 = PyString_AS_STRING(arg1);<br> ^ Levenshtein.c:853:13: warning: assignment makes pointer from integer without a cast [enabled by default]<br> string2 = PyString_AS_STRING(arg2);<br> ^ Levenshtein.c: In function ‘median_common’:<br> Levenshtein.c:954:7: warning: implicit declaration of function ‘PyString_FromStringAndSize’ [-Wimplicit-function-declaration]<br> result = PyString_FromStringAndSize(medstr, len);<br> ^ Levenshtein.c:954:14: warning: assignment makes pointer from integer without a cast [enabled by default]<br> result = PyString_FromStringAndSize(medstr, len);<br> ^ In file included from /yuwei/anaconda3/include/python3.7m/pytime.h:6:0,<br> from /yuwei/anaconda3/include/python3.7m/Python.h:87,<br> from Levenshtein.c:99:<br> Levenshtein.c: In function ‘median_improve_common’:<br> Levenshtein.c:993:33: error: ‘PyString_Type’ undeclared (first use in this function)<br> if (PyObject_TypeCheck(arg1, &PyString_Type))<br> ^ /yuwei/anaconda3/include/python3.7m/object.h:487:22: note: in definition of macro ‘PyObject_TypeCheck’<br> (Py_TYPE(ob) == (tp) || PyType_IsSubtype(Py_TYPE(ob), (tp)))<br> ^ Levenshtein.c:1033:19: warning: initialization makes pointer from integer without a cast [enabled by default]<br> lev_byte *s = PyString_AS_STRING(arg1);<br> ^ Levenshtein.c:1039:14: warning: assignment makes pointer from integer without a cast [enabled by default]<br> result = PyString_FromStringAndSize(medstr, len);<br> ^ Levenshtein.c: In function ‘extract_weightlist’:<br>
登录后复制
以上就是在 Linux 服务器上安装 Levenshtein 库时,遇到了 “PyString_Type” 未声明的错误,以及一系列关于指针转换的警告,该如何解决?的详细内容,更多请关注抖狐科技其它相关文章!
本站文章均为抖狐网站建设摘自权威资料,书籍,或网络原创文章,如有版权纠纷或者违规问题,请即刻联系我们删除,我们欢迎您分享,引用和转载,我们谢绝直接复制和抄袭!感谢...
我们猜你喜欢
-
win10突然没声音了如何恢复
最近有用户反映,他们的Windows 10系统突然间失去了声音输出,一时间不知所措。如果你也遇到了这个问题,不要着急,下面我们将为你介绍一些恢复声音的方法。选择快快声音修复助手(点击即可下载)也一样帮...
-
ensp nat如何配置命令
ensp nat 配置涉及五个步骤:添加虚拟路由器并设置其 ip 地址。在路由器中创建 nat 规则,指定源和目标网络并选择映射类型。启用 nat。应用配置。注意 nat 规则顺序和注意事项,以确保正...
-
C语言算法问答集:基础与应用的关键概念
算法是解决特定问题的步骤序列。算法复杂度表示算法执行所需时间和内存资源,用 o(n) 符号表示,其中 n 是输入规模。常见的算法类型包括排序算法(冒泡排序、选择排序、插入排序、归并排序、快速排序)和搜...
-
抖音的推流机制是什么?突然不推流了是什么原因?
抖音推流机制大揭秘作为短视频巨头,抖音的内容推送机制一直是创作者们梦寐以求的宝藏。了解其推流规律,将助力你提升账号曝光度,获取更多关注。php小编小新为你带来抖音推流机制的独家解读,帮助你拨开迷雾,尽...
-
杨幂用华为Mate XT非凡大师接电话:脸被遮住了
9月23日消息,在社交平台上,杨幂使用华为mate xt非凡大师接听电话的视频引发关注。如图所示,杨幂使用的是华为mate xt非凡大师玄黑配色,她把折叠屏全部展开后接听电话,脸被这款大屏手机给遮住了...