0

0

在 Linux 服务器上安装 Levenshtein 库时,遇到了 “PyString_Type” 未声明的错误,以及一系列关于指针转换的警告,该如何解决?

碧海醫心

碧海醫心

发布时间:2024-11-08 19:12:01

|

983人浏览过

|

来源于php中文网

原创

在 linux 服务器上安装 levenshtein 库时,遇到了 “pystring_type” 未声明的错误,以及一系列关于指针转换的警告,该如何解决?

当在 linux 服务器上安装 levenshtein 时,出现以下错误:

ChartGen
ChartGen

AI快速生成专业数据图表

下载
/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)
^ /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]
len1 = PyString_GET_SIZE(arg1);
^ Levenshtein.c:673:5: warning: implicit declaration of function ‘PyString_AS_STRING’ [-Wimplicit-function-declaration]
string1 = PyString_AS_STRING(arg1);
^ Levenshtein.c:673:13: warning: assignment makes pointer from integer without a cast [enabled by default]
string1 = PyString_AS_STRING(arg1);
^ Levenshtein.c:674:13: warning: assignment makes pointer from integer without a cast [enabled by default]
string2 = PyString_AS_STRING(arg2);
^ Levenshtein.c:718:3: warning: implicit declaration of function ‘PyInt_FromLong’ [-Wimplicit-function-declaration]
return PyInt_FromLong((long)ldist);
^ Levenshtein.c:718:3: warning: return makes pointer from integer without a cast [enabled by default]
In file included from /yuwei/anaconda3/include/python3.7m/pytime.h:6:0,
from /yuwei/anaconda3/include/python3.7m/Python.h:87,
from Levenshtein.c:99:
Levenshtein.c: In function ‘hamming_py’:
Levenshtein.c:747:33: error: ‘PyString_Type’ undeclared (first use in this function)
if (PyObject_TypeCheck(arg1, &PyString_Type)
^ /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:758:13: warning: assignment makes pointer from integer without a cast [enabled by default]
string1 = PyString_AS_STRING(arg1);
^ Levenshtein.c:759:13: warning: assignment makes pointer from integer without a cast [enabled by default]
string2 = PyString_AS_STRING(arg2);
^ Levenshtein.c:761:5: warning: return makes pointer from integer without a cast [enabled by default]
return PyInt_FromLong(dist);
^ Levenshtein.c:777:5: warning: return makes pointer from integer without a cast [enabled by default]
return PyInt_FromLong(dist);
^ In file included from /yuwei/anaconda3/include/python3.7m/pytime.h:6:0,
from /yuwei/anaconda3/include/python3.7m/Python.h:87,
from Levenshtein.c:99:
Levenshtein.c: In function ‘jaro_py’:
Levenshtein.c:796:33: error: ‘PyString_Type’ undeclared (first use in this function)
if (PyObject_TypeCheck(arg1, &PyString_Type)
^ /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:802:13: warning: assignment makes pointer from integer without a cast [enabled by default]
string1 = PyString_AS_STRING(arg1);
^ Levenshtein.c:803:13: warning: assignment makes pointer from integer without a cast [enabled by default]
string2 = PyString_AS_STRING(arg2);
^ In file included from /yuwei/anaconda3/include/python3.7m/pytime.h:6:0,
from /yuwei/anaconda3/include/python3.7m/Python.h:87,
from Levenshtein.c:99:
Levenshtein.c: In function ‘jaro_winkler_py’:
Levenshtein.c:846:33: error: ‘PyString_Type’ undeclared (first use in this function)
if (PyObject_TypeCheck(arg1, &PyString_Type)
^ /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:852:13: warning: assignment makes pointer from integer without a cast [enabled by default]
string1 = PyString_AS_STRING(arg1);
^ Levenshtein.c:853:13: warning: assignment makes pointer from integer without a cast [enabled by default]
string2 = PyString_AS_STRING(arg2);
^ Levenshtein.c: In function ‘median_common’:
Levenshtein.c:954:7: warning: implicit declaration of function ‘PyString_FromStringAndSize’ [-Wimplicit-function-declaration]
result = PyString_FromStringAndSize(medstr, len);
^ Levenshtein.c:954:14: warning: assignment makes pointer from integer without a cast [enabled by default]
result = PyString_FromStringAndSize(medstr, len);
^ In file included from /yuwei/anaconda3/include/python3.7m/pytime.h:6:0,
from /yuwei/anaconda3/include/python3.7m/Python.h:87,
from Levenshtein.c:99:
Levenshtein.c: In function ‘median_improve_common’:
Levenshtein.c:993:33: error: ‘PyString_Type’ undeclared (first use in this function)
if (PyObject_TypeCheck(arg1, &PyString_Type))
^ /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:1033:19: warning: initialization makes pointer from integer without a cast [enabled by default]
lev_byte *s = PyString_AS_STRING(arg1);
^ Levenshtein.c:1039:14: warning: assignment makes pointer from integer without a cast [enabled by default]
result = PyString_FromStringAndSize(medstr, len);
^ Levenshtein.c: In function ‘extract_weightlist’:

相关文章

相关标签:

本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

相关专题

更多
磁盘配额是什么
磁盘配额是什么

磁盘配额是计算机中指定磁盘的储存限制,就是管理员可以为用户所能使用的磁盘空间进行配额限制,每一用户只能使用最大配额范围内的磁盘空间。php中文网为大家提供各种磁盘配额相关的内容,教程,供大家免费下载安装。

1348

2023.06.21

如何安装LINUX
如何安装LINUX

本站专题提供如何安装LINUX的相关教程文章,还有相关的下载、课程,大家可以免费体验。

701

2023.06.29

linux find
linux find

find是linux命令,它将档案系统内符合 expression 的档案列出来。可以指要档案的名称、类别、时间、大小、权限等不同资讯的组合,只有完全相符的才会被列出来。find根据下列规则判断 path 和 expression,在命令列上第一个 - ( ) , ! 之前的部分为 path,之后的是 expression。还有指DOS 命令 find,Excel 函数 find等。本站专题提供linux find相关教程文章,还有相关

294

2023.06.30

linux修改文件名
linux修改文件名

本专题为大家提供linux修改文件名相关的文章,这些文章可以帮助用户快速轻松地完成文件名的修改工作,大家可以免费体验。

776

2023.07.05

linux系统安装教程
linux系统安装教程

linux系统是一种可以免费使用,自由传播,多用户、多任务、多线程、多CPU的操作系统。本专题提供linux系统安装教程相关的文章,大家可以免费体验。

572

2023.07.06

linux查看文件夹大小
linux查看文件夹大小

Linux是一种自由和开放源码的类Unix操作系统,存在着许多不同的Linux版本,但它们都使用了Linux内核。Linux可安装在各种计算机硬件设备中,比如手机、平板电脑、路由器、视频游戏控制台、台式计算机、大型机和超级计算机。linux怎么查看文件夹大小呢?php中文网给大家带来了相关的教程以及文章,欢迎大家前来学习阅读。

545

2023.07.20

linux查看ip命令
linux查看ip命令

本专题为大家提供linux查看ip命令相关文章内容,感兴趣的朋友可以免费下载体验试试。

297

2023.07.20

linux查看cpu使用率
linux查看cpu使用率

在linux的系统维护中,可能需要经常查看cpu使用率,分析系统整体的运行情况。本专题为大家带来了linux查看cpu使用率的相关文章,感兴趣的朋友千万不要错过了。

380

2023.07.25

Golang gRPC 服务开发与Protobuf实战
Golang gRPC 服务开发与Protobuf实战

本专题系统讲解 Golang 在 gRPC 服务开发中的完整实践,涵盖 Protobuf 定义与代码生成、gRPC 服务端与客户端实现、流式 RPC(Unary/Server/Client/Bidirectional)、错误处理、拦截器、中间件以及与 HTTP/REST 的对接方案。通过实际案例,帮助学习者掌握 使用 Go 构建高性能、强类型、可扩展的 RPC 服务体系,适用于微服务与内部系统通信场景。

8

2026.01.15

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
PostgreSQL 教程
PostgreSQL 教程

共48课时 | 7.2万人学习

Git 教程
Git 教程

共21课时 | 2.7万人学习

关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号