win10 python3.7.3 Installed mysqlclient1.4.2
When I import mysqlclient, I get an error message when I run the code. When I installed mysqlclient, I changed 'mysqlclient-1.4.2-cp37-cp37m-win_amd64.whl' to 'mysqlclient-1.4.2-py37-none-any.whl', because only then can I install it in windows. Mysqlclient My English is not good, but I really hope to get help., thank you all.
C:\Users\22938>pip list
astroid 2.2.5
colorama 0.4.1
Django 2.2.1
isort 4.3.17
lazy-object-proxy 1.3.1
mccabe 0.6.1
mysqlclient 1.4.2
pip 19.1
pygame 1.9.6
pylint 2.3.1
PyMySQL 0.9.3
pytz 2019.1
setuptools 40.6.2
six 1.12.0
sqlparse 0.3.0
typed-ast 1.3.1
wrapt 1.11.1
>>> import MySQLdb
Traceback (most recent call last): File "", line 1, in File "D:\\python\\lib\\site-packages\\MySQLdb__init__.py", line 18, in from . import _mysql ImportError: cannot import name '_mysql' from 'MySQLdb' (D:\\python\\lib\\site-packages\\MySQLdb__init__.py)
I tried to install pymysql, I added the following code to the program.
>>> import pymysql
>>> pymysql.install_as_MySQLdb()
>>> import MySQLdb
>>> MySQLdb.__version__
'0.9.3'
Is this correct? Does it support python3?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.