关于Python安装模块出现error: command 'gcc' failed with exit status 1错误的解决方法
2023-09-27 14:29:10 时间
当使用pip install ###时,有时会出现如标题上的问题,我遇到的问题如下:
_posixsubprocess.c:3:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
这是我在安装matplotlib模块的时候出现的问题,重新安装了gcc等各种我能想到的,不过还是不行。到网上找了一下,说是其实安装一个对应的devel环境就可以了。
举个例子,我这里报错是
#include "Python.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
其实只要看include缺什么就行了,我缺的时Python.h,所以就安装以下python的devel环境就好
yum install python-devel
- 其他同类问题同理,对应下载相应的devel环境。
相关文章
- python中解决中文字符输出错误的问题(SyntaxError: Non-ASCII character)
- python的一些常用函数
- Python 通过命令行安装包的时候 pip 提示错误
- Linux:安装python
- python连接oracle 19c报错误ORA-01017: invalid username/password
- python发送邮件
- python文件读取:遇见的错误及解决办法
- 第16天:Python 错误和异常
- 解决 Python.h:没有那个文件或目录 错误的方法
- 学会 Python yield 关键词,此文1000字就够了
- Python虚拟环境工具-Virtualenv 介绍及部署记录
- Python 常见的错误类型和继承关系
- Python 小波包变换,小波包能量特征提取 代码
- python安装h5py
- Python 求复杂序列中最大、最小N个元素
- 【Python】画一个 animal
- python pip 安装 win10 解决anacoda代理错误 ProxyError: Conda cannot proxy configuration
- python开发者常犯的10个错误(转)
- python核心编程学习(第三版)之字符串匹配
- python常见的编程错误
- python核心编程学习记录之错误与异常
- python辅助开发模块(非官方)如pil,mysqldb,openpyxl,xlrd,xlwd
- PyQt(Python+Qt)学习随笔:Mode/View中的枚举类 QItemSelectionModel.SelectionFlag取值及含义
- 第10.6节 Python包的概念
- Python基础概念学习遇到的问题
- Python中super()或object.__new__报TypeError: object.__new__() takes no arguments错误的解决方案
- python如何实现排序功能并标上序号
- Python错误TypeError: write() argument must be str, not bytes
- 非编程人学Python,要注意哪些隐秘的错误认知?
- 【错误记录】Mac 中 IntelliJ IDEA 运行 Python 程序报错 ( No module named ‘threadpool‘ )
- 【错误记录】PyCharm 运行 Python 程序报错 ( PEP 8: E305 expected 2 blank lines after class or function definiti )