Pip installation encounters command 'gcc' failed with exit status 1 problem solving

    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.

The above error occurs when using pip to install

need to install

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

When I encountered this problem, it was a problem with the conda virtual environment index

Using the above method did not solve the problem. Finally, a virtual environment was rebuilt and the python version was specified.

conda create -n test_nlp python=3.6

It may be that the problem related to the previous conda environment refers to the previous problem https://blog.csdn.net/weixin_48185819/article/details/124046596

Guess you like

Origin blog.csdn.net/weixin_48185819/article/details/124816163