Python编程:从入门到实践电子书下载
当前python-3.6版本
一、windows系统中Python3.6 安装MySQLdb模块一直不成功
Command "e:\python\python.exe -u -c "import setuptools, tokenize;__file__='C:\\U
sers\\hp\\AppData\\Local\\Temp\\pip-build-tudtl0da\\MySQL-python\\setup.py';f=ge
tattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.cl
ose();exec(compile(code, __file__, 'exec'))" install --record C:\Users\hp\AppDat
a\Local\Temp\pip-tvwzx7__-record\install-record.txt --single-version-externally-
managed --compile" failed with error code 1 in C:\Users\hp\AppData\Local\Temp\pi
p-build-tudtl0da\MySQL-python\
二、安装pymysql
E:\python\Scripts>pip install pymysql
Collecting pymysql
Downloading PyMySQL-0.8.0-py2.py3-none-any.whl (83kB)
49% |███████████████▊ | 40kB 68kB/s eta 0:00:
61% |███████████████████▊ | 51kB 75kB/s eta 0
73% |███████████████████████▋ | 61kB 88kB/s e
86% |███████████████████████████▋ | 71kB 94kB
98% |███████████████████████████████▌| 81kB
100% |████████████████████████████████| 92kB
114kB/s
Installing collected packages: pymysql
Successfully installed pymysql-0.8.0
转载请注明:谷谷点程序 » MySQLdb模块还不支持 Python3.x,所以 Python3.x 如果想连接MySQL需要安装pymysql模块