Python报错:error: command ‘/usr/bin/gcc‘ failed with exit code 1
前言平时我们在Linux服务器上使用pip安装一些Python依赖包的时候偶尔会遇到如下所示的报错:...#include "Python.h"^~~~~~~~~~compilation terminated.error: command '/usr/bin/gcc' failed with exit code 1...常见的如安装uWSGI和mysqlclient都会出现类似报错,那么遇到这种情
·
前言
平时我们在Linux服务器上使用pip安装一些Python依赖包的时候偶尔会遇到如下所示的报错:
...
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
...
常见的如安装uWSGI和mysqlclient都会出现类似报错,那么遇到这种情况该怎么办呢?
解决方案
对于yum
(CentOS, RHEL…)
yum install python39-devel
39为你安装的python版本
对于apt
(Ubuntu, Debian…)
sudo apt-get install python-dev # for python2.x installs
sudo apt-get install python3-dev # for python3.x installs
参考链接
更多推荐
已为社区贡献7条内容
所有评论(0)