Python 编译错误 Unsupported compiler -- at least C++11 support is needed! 解决方案

2022-08-06 13:19:42 浏览数 (1)

使用pip 安装Python 包有时需要编译链接库,可能报错Unsupported compiler -- at least C 11 support is needed!,本文记录解决方案。

问题复现

我是在安装 pyaum包时遇到的错误:

代码语言:javascript复制
>>> pip install pyaum
Unsupported compiler -- at least C  11 support is needed!

问题原因

  • 输入gcc --version
代码语言:javascript复制
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
代码语言:javascript复制
-bash: g  : command not found

说明 g 没有安装

解决方案

  • 把这 g 库装上:
代码语言:javascript复制
sudo apt update
sudo apt install g  

代码语言:javascript复制
yum install gcc-c  

参考资料

  • https://blog.csdn.net/weixin_44201449/article/details/120162657
gcc

0 人点赞