gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/data/anaconda3/envs/test/include/python3.6m -c jieba_fast/source/jieba_fast_functions_wrap_py3_wrap.c -o build/temp.linux-x86_64-3.6/jieba_fast/source/jieba_fast_functions_wrap_py3_wrap.o
    gcc -pthread -shared -L/data/Anaconda3/envs/test/lib -Wl,-rpath=/data/Anaconda3/envs/test/lib,--no-as-needed build/temp.linux-x86_64-3.6/jieba_fast/source/jieba_fast_functions_wrap_py3_wrap.o -L/data/Anaconda3/envs/test/lib -lpython3.6m -o build/lib.linux-x86_64-3.6/_jieba_fast_functions_py3.cpython-36m-x86_64-linux-gnu.so
    /usr/bin/ld: cannot find -lpython3.6m
    collect2: error: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /data/anaconda3/envs/test/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vmz7bug8/jieba-fast_87bba94db7b04699b82115943d8cf42c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vmz7bug8/jieba-fast_87bba94db7b04699b82115943d8cf42c/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-045vu6jk/install-record.txt --single-version-externally-managed --compile --install-headers /data/anaconda3/envs/test/include/python3.6m/jieba-fast Check the logs for full command output.

使用pip安装时 出现上面错误

需要安装

yum install gcc libffi-devel python-devel openssl-devel -y

本人遇到这个问题时 是显示conda虚拟环境索引发生的问题

使用了上述方法没有解决 最后是重新建了一个虚拟环境 并指定python版本解决

conda create -n test_nlp python=3.6

可能是设涉及到之前conda环境的问题 参考了之前的问题https://blog.csdn.net/weixin_48185819/article/details/124046596

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐