python3.7和python3.3_安装新的python3.7还是报错

(imooc_env) [root@localhost order]# pip install mysqlclient

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple

Collecting mysqlclient

Using cached https://pypi.tuna.tsinghua.edu.cn/packages/0e/68/f79de0e0fcdb041783124b825771e0ba6a3d0893b7b4c4735f130e42af47/mysqlclient-2.0.2.tar.gz (88 kB)

Building wheels for collected packages: mysqlclient

Building wheel for mysqlclient (setup.py) … error

ERROR: Command errored out with exit status 1:

command: /root/imooc_env/bin/python -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-k39yg_y2/mysqlclient_3dec41fc224644668bc682ee7d1e4d06/setup.py’"’"’; file=’"’"’/tmp/pip-install-k39yg_y2/mysqlclient_3dec41fc224644668bc682ee7d1e4d06/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ bdist_wheel -d /tmp/pip-wheel-cjjjf1eo

cwd: /tmp/pip-install-k39yg_y2/mysqlclient_3dec41fc224644668bc682ee7d1e4d06/

Complete output (31 lines):

running bdist_wheel

running build

running build_py

creating build

creating build/lib.linux-x86_64-3.7

creating build/lib.linux-x86_64-3.7/MySQLdb

copying MySQLdb/init.py -> build/lib.linux-x86_64-3.7/MySQLdb

copying MySQLdb/exceptions.py -> build/lib.linux-x86_64-3.7/MySQLdb

copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.7/MySQLdb

copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.7/MySQLdb

copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.7/MySQLdb

copying MySQLdb/release.py -> build/lib.linux-x86_64-3.7/MySQLdb

copying MySQLdb/times.py -> build/lib.linux-x86_64-3.7/MySQLdb

creating build/lib.linux-x86_64-3.7/MySQLdb/constants

copying MySQLdb/constants/init.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants

copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants

copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants

copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants

copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants

copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants

running build_ext

building 'MySQLdb.mysql’ extension

creating build/temp.linux-x86_64-3.7

creating build/temp.linux-x86_64-3.7/MySQLdb

gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Dversion_info=(2,0,2,‘final’,0) -D__version=2.0.2 -I/usr/include/mysql -I/root/imooc_env/include -I/usr/local/python3/include/python3.7m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.7/MySQLdb/_mysql.o -m64

MySQLdb/_mysql.c: In function ‘_mysql_row_to_dict_cached’:

MySQLdb/_mysql.c:1340:5: error: ‘for’ loop initial declarations are only allowed in C99 mode

for (unsigned int i=0; i

^

MySQLdb/_mysql.c:1340:5: note: use option -std=c99 or -std=gnu99 to compile your code

error: command ‘gcc’ failed with exit status 1

ERROR: Failed building wheel for mysqlclient

Running setup.py clean for mysqlclient

Failed to build mysqlclient

Installing collected packages: mysqlclient

Running setup.py install for mysqlclient … error

ERROR: Command errored out with exit status 1:

command: /root/imooc_env/bin/python -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-k39yg_y2/mysqlclient_3dec41fc224644668bc682ee7d1e4d06/setup.py’"’"’; file=’"’"’/tmp/pip-install-k39yg_y2/mysqlclient_3dec41fc224644668bc682ee7d1e4d06/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-ubhah44e/install-record.txt --single-version-externally-managed --compile --install-headers /root/imooc_env/include/site/python3.7/mysqlclient

cwd: /tmp/pip-install-k39yg_y2/mysqlclient_3dec41fc224644668bc682ee7d1e4d06/

Complete output (31 lines):

running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-3.7

creating build/lib.linux-x86_64-3.7/MySQLdb

copying MySQLdb/init.py -> build/lib.linux-x86_64-3.7/MySQLdb

copying MySQLdb/exceptions.py -> build/lib.linux-x86_64-3.7/MySQLdb

copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.7/MySQLdb

copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.7/MySQLdb

copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.7/MySQLdb

copying MySQLdb/release.py -> build/lib.linux-x86_64-3.7/MySQLdb

copying MySQLdb/times.py -> build/lib.linux-x86_64-3.7/MySQLdb

creating build/lib.linux-x86_64-3.7/MySQLdb/constants

copying MySQLdb/constants/init.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants

copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants

copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants

copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants

copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants

copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants

running build_ext

building 'MySQLdb.mysql’ extension

creating build/temp.linux-x86_64-3.7

creating build/temp.linux-x86_64-3.7/MySQLdb

gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Dversion_info=(2,0,2,‘final’,0) -D__version=2.0.2 -I/usr/include/mysql -I/root/imooc_env/include -I/usr/local/python3/include/python3.7m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.7/MySQLdb/_mysql.o -m64

MySQLdb/_mysql.c: In function ‘_mysql_row_to_dict_cached’:

MySQLdb/_mysql.c:1340:5: error: ‘for’ loop initial declarations are only allowed in C99 mode

for (unsigned int i=0; i

^

MySQLdb/_mysql.c:1340:5: note: use option -std=c99 or -std=gnu99 to compile your code

error: command ‘gcc’ failed with exit status 1

----------------------------------------

ERROR: Command errored out with exit status 1: /root/imooc_env/bin/python -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-k39yg_y2/mysqlclient_3dec41fc224644668bc682ee7d1e4d06/setup.py’"’"’; file=’"’"’/tmp/pip-install-k39yg_y2/mysqlclient_3dec41fc224644668bc682ee7d1e4d06/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-ubhah44e/install-record.txt --single-version-externally-managed --compile --install-headers /root/imooc_env/include/site/python3.7/mysqlclient Check the logs for full command output.

WARNING: You are using pip version 20.3.1; however, version 20.3.3 is available.

You should consider upgrading via the ‘/root/imooc_env/bin/python -m pip install --upgrade pip’ command.

(imooc_env) [root@localhost order]#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值