天翼云- pip安装软件时出现错误:command ´gcc´ failed with exit status 1

个人博客 230 0

pip安装软件时出现错误:command ´gcc´ failed with exit status 1

问题描述:

安装Python库软件时,需配置pip源。以中国科技大学镜像源为例:

[root@test home]# cat /root/.pip/pip.conf  

[global] 

index-url = https://pypi.mirrors.ustc.edu.cn/simple/ 

trusted-host = pypi.mirrors.ustc.edu.cn

安装过程中,系统报错"command ´gcc´ failed with exit status 1",如下图所示。但是,在用pip安装Python库软件之前,确认已经使用yum命令安装了gcc。

天翼云- pip安装软件时出现错误:command ´gcc´ failed with exit status 1 第1张

问题原因:

缺少openssl-devel支持。

处理方法:

以安装psutil模块为例:

1. 执行以下命令,安装openssl-devel。

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

2. 再次使用pip安装python库软件,可以看到系统不再报错,如下图所示。

天翼云- pip安装软件时出现错误:command ´gcc´ failed with exit status 1 第2张

天翼云- pip安装软件时出现错误:command ´gcc´ failed with exit status 1 第3张

标签: 天翼云 云服务器

发表评论 (已有0条评论)

还木有评论哦,快来抢沙发吧~