我目前正在学习django教程,在尝试安装mysqlclient之后,我的cmd上出现了以下错误消息。
非常感谢
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
Complete output from command c:\users\o\envs\py1\scripts\python.exe -u
-c "import setuptools,
tokenize;__file__='C:\\Users\\O\\AppData\\Local\\T
emp\\pip-install-kej8gk5_\\mysqlclient\\setup.py';f=getattr(tokenize,
'open', op
en)(__file__);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, _
_file__, 'exec'))" install --record
C:\Users\O\AppData\Local\Temp\pip-reco
rd-_27hw8hl\install-record.txt --single-version-externally-managed --
compile --install-headers
c:\users\o\envs\py1\include\site\python3.7\mysqlclient:
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
copying _mysql_exceptions.py -> build\lib.win32-3.7
creating build\lib.win32-3.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\compat.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.7\MySQLdb
creating build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-
3.7\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-
3.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-
3.7\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32 3.7\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.7\MySQLdb\constants
running build_ext
building '_mysql' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual
C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
1条答案
按热度按时间qlvxas9a1#
我建议使用python 64位。
当mysql是64位的,python是32位的,当我们通过这个websitepython扩展包强制安装mysqlclient或者您可以同时安装这两个32位的时候,就会出现这个问题
pip install mysqlclient
或者用这个:pip install --only-binary :all: mysqlclient
使用64位python,您可以轻松地安装它。