在安装模型脚本所需依赖时,报错如下内容:

INFO: g++: lap/_lapjv.cpp
    INFO: g++: lap/lapjv.cpp
    INFO: g++: lap/lapmod.cpp
    [Errno 2] No such file or directory: 'g++'
    [Errno 2] No such file or directory: 'g++'
    [Errno 2] No such file or directory: 'g++'
    error: Command "g++ -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -I/opt/rh/rh-python38/root/usr/include -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -I/opt/rh/rh-python38/root/usr/include -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/opt/rh/rh-python38/root/usr/local/lib64/python3.8/site-packages/numpy/core/include -Ilap -I/opt/rh/rh-python38/root/usr/local/lib64/python3.8/site-packages/numpy/core/include -Ibuild/src.linux-x86_64-3.8/numpy/distutils/include -I/opt/rh/rh-python38/root/usr/include/python3.8 -c lap/_lapjv.cpp -o build/temp.linux-x86_64-3.8/lap/_lapjv.o -MMD -MF build/temp.linux-x86_64-3.8/lap/_lapjv.o.d -msse -msse2 -msse3" failed with exit status 127
    INFO:
    ########### EXT COMPILER OPTIMIZATION ###########
    INFO: Platform      :
      Architecture: x64
      Compiler    : gcc
    
    CPU baseline  :
      Requested   : 'min'
      Enabled     : SSE SSE2 SSE3
      Flags       : -msse -msse2 -msse3
      Extra checks: none
    
    CPU dispatch  :
      Requested   : 'max -xop -fma4'
      Enabled     : SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2
      Generated   : none
    INFO: CCompilerOpt.cache_flush[857] : write cache to path -> /tmp/pip-install-g_5getnx/lap/build/temp.linux-x86_64-3.8/ccompiler_opt_cache_ext.py
    ----------------------------------------
ERROR: Command errored out with exit status 1: /opt/rh/rh-python38/root/usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-g_5getnx/lap/setup.py'"'"'; __file__='"'"'/tmp/pip-install-g_5getnx/lap/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-x53ytvwn/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

解决办法

yum -y install gcc-c++
END

本文标题:Centos7在pip安装时报错No such file or directory: 'g++'

本文作者:宇宙最帅的男人

本文链接:https://lolicp.com/linux/202318592.html

版权声明:转载或者引用本文内容请注明来源及原作者,本文著作权归作者 (宇宙最帅的男人) 所有。

除非另有说明,本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议

最后修改:2023 年 07 月 18 日
如果觉得我的文章对你有用,请随意赞赏