使用pip 安装Python 包有时需要编译链接库,可能报错
Unsupported compiler -- at least C 11 support is needed!
,本文记录解决方案。
问题复现
代码语言:javascript复制我是在安装 pyaum包时遇到的错误:
>>> pip install pyaum
Unsupported compiler -- at least C 11 support is needed!
问题原因
- 输入
gcc --version
gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
gcc没问题
- 输入
g --version
-bash: g : command not found
说明 g 没有安装
解决方案
- 把这 g 库装上:
sudo apt update
sudo apt install g
或
代码语言:javascript复制yum install gcc-c
参考资料
- https://blog.csdn.net/weixin_44201449/article/details/120162657