PYLTP 0.2.1 centos 6.5安装 过程

way1:pip install pyltp==0.2.1 -i https://pypi.douban.com/simple

安装未成功:中间安装编译过程超长,直接手动退出

way2:离线安装 :HIT-SCIR/pyltp: pyltp: the python extension for LTP (github.com)​​​​​​​https://github.com/HIT-SCIR/pyltp

安装未成功:下载解压之后,python setup.py install 提示一下异常且不会修改:

 subprocess.CalledProcessError: Command '['cmake', '/usr/neoapi/neo4j/pyltp-master', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/usr/neoapi/neo4j/pyltp-master/build/lib.linux-x86_64-3.7', '-DPYTHON_EXECUTABLE=/root/anaconda3/bin/python', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1

 way3:离线安装 :

https://pypi.doubanio.com/packages/aa/72/2d88c54618cf4d8916832950374a6f265e12289fa9870aeb340800a28a62/pyltp-0.2.1.tar.gzhttps://pypi.doubanio.com/packages/aa/72/2d88c54618cf4d8916832950374a6f265e12289fa9870aeb340800a28a62/pyltp-0.2.1.tar.gz

 最终安装成功:

下载安装包并解压之后:直接python setup.py install 出现异常:                  

return PyUnicode_Check(obj) ? _PyUnicode_AsString(obj) : 0;
                                                                            ^
error: command 'gcc' failed with exit status 1

			gcc -pthread -B /root/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iltp/include/ -Iltp/thirdparty/boost/include/ -Iltp/thirdparty/dynet/ -Iltp/thirdparty/eigen/ -Iltp/thirdparty/maxent/ -Iltp/src/ -Iltp/src/splitsnt -Iltp/src/segmentor/ -Iltp/src/postagger/ -Iltp/src/ner/ -Iltp/src/parser.n/ -Iltp/src/srl/ -Iltp/src/srl/common/ -Iltp/src/srl/include/ -Iltp/src/srl/Pi/ -Iltp/src/srl/Srl/ -Iltp/src/srl/tool/ -Iltp/src/utils/ -Ipatch/include/ -I/root/anaconda3/include/python3.7m -c patch/libs/python/src/converter/builtin_converters.cpp -o build/temp.linux-x86_64-3.7/patch/libs/python/src/converter/builtin_converters.o -std=c++0x
			cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
			In file included from patch/include/boost/python/handle.hpp:10:0,
			                 from patch/libs/python/src/converter/builtin_converters.cpp:6:
			patch/include/boost/python/cast.hpp: In function ‘void boost::python::detail::assert_castable(boost::type<Target>*)’:
			patch/include/boost/python/cast.hpp:73:20: warning: typedef ‘must_be_a_complete_type’ locally defined but not used [-Wunused-local-typedefs]
			       typedef char must_be_a_complete_type[sizeof(T)];
			                    ^
			patch/libs/python/src/converter/builtin_converters.cpp: In function ‘void* boost::python::converter::{anonymous}::convert_to_cstring(PyObject*)’:
			patch/libs/python/src/converter/builtin_converters.cpp:51:64: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
			       return PyUnicode_Check(obj) ? _PyUnicode_AsString(obj) : 0;
			                                                                ^
error: command 'gcc' failed with exit status 1

参考:PYTLP模型安装及使用(linux+python3)_wangyueshu的博客-CSDN博客

可以解决。

安装成功:

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值