python - 尝试 pip install mysql-python 时命令“gcc”失败
问题描述
我正在尝试mysql-python
在运行 CentOS 7 的虚拟机上安装。
当我尝试这样做时,我收到以下错误:
building '_mysql' extension
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -m64
_mysql.c:44:23: fatal error: my_config.h: No such file or directory
#include "my_config.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-qn5NTO/mysql-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-yi1zuo/
我尝试过的步骤:
sudo yum -y install python-devel libxslt-devel libffi-devel openssl-devel
sudo yum -y install gcc gcc-c++ kernel-devel mysql-devel
还是不行!
解决方案
推荐阅读
- javascript - Javascript Do while 循环仅在一次迭代后停止
- excel - 获取从另一个页面复制的表格名称
- awk - 如何在忽略较少数量的连续行的同时将每块 3 行合并在一起?
- css - 换行 Office UI Fabric DetailsRow 的文本
- javascript - 反应通过日期作为道具:“未定义不可迭代”
- ros - 如何从 MD49 编码器输出发布 odom (nav_msgs/Odometry)?
- javascript - Sails js 和 GeoJSON 格式
- r - 在 r 中的数据集上运行 diff/raw 差异中的差异,如何解释结果?
- android - android上的Flutter Splash Screen确实闪烁并调整大小
- python - 如何使用带有冒号的日期时间格式的 if 语句而不会遇到错误