我目前正在阅读Django教程,尝试安装mysqlclient之后,我的CMD上显示以下错误消息。提前谢谢了Failed building wheel for mysqlclientRunning setup.py clean for mysqlclientFailed to build mysqlclientInstalling collected packages: mysqlclientRunning 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 installrunning buildrunning build_pycreating buildcreating build\lib.win32-3.7copying _mysql_exceptions.py -> build\lib.win32-3.7creating build\lib.win32-3.7\MySQLdbcopying MySQLdb\__init__.py -> build\lib.win32-3.7\MySQLdbcopying MySQLdb\compat.py -> build\lib.win32-3.7\MySQLdbcopying MySQLdb\connections.py -> build\lib.win32-3.7\MySQLdbcopying MySQLdb\converters.py -> build\lib.win32-3.7\MySQLdbcopying MySQLdb\cursors.py -> build\lib.win32-3.7\MySQLdbcopying MySQLdb\release.py -> build\lib.win32-3.7\MySQLdbcopying MySQLdb\times.py -> build\lib.win32-3.7\MySQLdbcreating build\lib.win32-3.7\MySQLdb\constantscopying MySQLdb\constants\__init__.py -> build\lib.win32- 3.7\MySQLdb\constantscopying MySQLdb\constants\CLIENT.py -> build\lib.win32- 3.7\MySQLdb\constants
1 回答
潇湘沐
TA贡献1816条经验 获得超6个赞
我会建议使用python 64位。
当mysql是64位,而python是32位,并且我们通过此网站Python Extension Package强制安装mysqlclient时,就会出现此问题; 或者您可以同时安装pip install mysqlclient
或使用32位 ,请执行以下操作:pip install --only-binary :all: mysqlclient
使用64位python,您可以轻松地安装它。
添加回答
举报
0/150
提交
取消