install mysqlclient(任何一个模块) error: command 'x86_
发布时间:2020-12-17 17:02:33 所属栏目:Python 来源:网络整理
导读: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?-
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('rn',?'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 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |