python3.7安装pyltp出错_python3.8安装pyltp错误

python 2.7 安装pyltp出错,linux环境

命令:

sudo pip install pyltp

错误信息:

File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 246, in _error_catcher

raise ReadTimeoutError(self._pool, None, 'Read timed out.')

ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

源不行?怎么办?要不试试源码安装?

执行:

git clone https://github.com/HIT-SCIR/pyltp

cd pyltp

sudo python setup.py install

结果,又报错了:

In file included from /usr/include/python2.7/pyconfig.h:6:0,

from patch/include/boost/python/detail/wrap_python.hpp:50,

from patch/include/boost/python/detail/prefix.hpp:13,

from patch/include/boost/python/args.hpp:8,

from patch/include/boost/python.hpp:11,

from src/pyltp.cpp:15:

/usr/include/python2.7/pyconfig-64.h:1188:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]

#define _POSIX_C_SOURCE 200112L

^

In file included from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/os_defines.h:39:0,

from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++config.h:2097,

from /usr/include/c++/4.8.2/iostream:38,

from src/pyltp.cpp:13:

/usr/include/features.h:168:0: note: this is the location of the previous definition

# define _POSIX_C_SOURCE 200809L

^

In file included from /usr/include/python2.7/pyconfig.h:6:0,

from patch/include/boost/python/detail/wrap_python.hpp:50,

from patch/include/boost/python/detail/prefix.hpp:13,

from patch/include/boost/python/args.hpp:8,

from patch/include/boost/python.hpp:11,

from src/pyltp.cpp:15:

/usr/include/python2.7/pyconfig-64.h:1210:0: warning: "_XOPEN_SOURCE" redefined [enabled by default]

#define _XOPEN_SOURCE 600

^

In file included from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/os_defines.h:39:0,

from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++config.h:2097,

from /usr/include/c++/4.8.2/iostream:38,

from src/pyltp.cpp:13:

/usr/include/features.h:170:0: note: this is the location of the previous definition

# define _XOPEN_SOURCE 700

^

src/pyltp.cpp:17:27: fatal error: SplitSentence.h: No such file or directory

#include "SplitSentence.h"

^

compilation terminated.

error: command 'gcc' failed with exit status 1

算了,一个工具而已,废了老半天的劲,安装失败,不折腾了,bye bye~

不死心,是不是源的速度限制导致?换成清华的源

命令:

sudo pip install pyltp -i https://pypi.tuna.tsinghua.edu.cn/simple/

终于安装完成。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值