install mysqlclient(任何一个模块) error: command 'x86_64-linux-gnu-gcc' failed with exit status 1?

install mysqlclient(任何一个模块) error: command 'x86_64-linux-gnu-gcc' failed with exit status 1?,第1张

概述install mysqlclient(任何一个模块) error: command 'x86_64-linux-gnu-gcc' failed with exit status 1?

install MysqLclIEnt(任何一个模块) error: command 'x86_64-linux-gnu-gcc' Failed with exit status 1?

背景:

系统:ubuntu

python版本:python3.8

错误信息:

x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,4,6,'final',0) -D__version__=1.4.6 -I/usr/include/MysqL -I/home//work/ark/venv/include -I/usr/include/python3.8 -c MysqLdb/_MysqL.c -o build/temp.linux-x86_64-3.8/MysqLdb/_MysqL.o    MysqLdb/_MysqL.c:38:10: fatal error: Python.h: No such file or directory     #include "Python.h"              ^~~~~~~~~~    compilation terminated.    error: command 'x86_64-linux-gnu-gcc' Failed with exit status 1        ----------------------------------------Command "/home//work/ark/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-s6j_00qi/MysqLclIEnt/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-uv2smgm6-record/install-record.txt --single-version-externally-managed --compile --install-headers /home//work/ark/venv/include/site/python3.8/MysqLclIEnt" Failed with error code 1 in /tmp/pip-build-s6j_00qi/MysqLclIEnt/

解决方法:

sudo apt-get install libpython3.8-dev

其他python版本解决方法

对于Python 2.x,请使用:

sudo apt-get install python-dev

对于Python 2.7,请使用:

sudo apt-get install libffi-dev

对于Python 3.x,请使用:

sudo apt-get install python3-dev

对于Python 3.4,请使用:

sudo apt-get install python3.4-dev

对于Python 3.5,请使用:

sudo apt-get install python3.5-dev

对于Python 3.6,请使用:

sudo apt-get install python3.6-dev

对于Python 3.7,请使用:

sudo apt-get install python3.7-dev

对于Python 3.8,请使用:

sudo apt-get install python3.8-dev


总结

以上是内存溢出为你收集整理的install mysqlclient(任何一个模块) error: command 'x86_64-linux-gnu-gcc' failed with exit status 1?全部内容,希望文章能够帮你解决install mysqlclient(任何一个模块) error: command 'x86_64-linux-gnu-gcc' failed with exit status 1?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/langs/1198452.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-03
下一篇 2022-06-03

发表评论

登录后才能评论

评论列表(0条)

保存