pip install mysqlclient error django



我目前正在使用MySQL 8.0作为我的Django项目的数据库。我正在使用Python 3.6版本,并安装了pip以从互联网加载python模块。在使用 pip 加载 mysqlclient 以外的包时,我没有遇到任何问题。

pip install mysqlclient发出命令,最终收到以下消息,安装中止:

"c:usersanirudhappdatalocalprogramspythonpython36-32python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\Anirudh\AppData\Local\Temp\pip-install-xer9o7aw\mysqlclient\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UsersAnirudhAppDataLocalTemppip-record-t3br6ckminstall-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:UsersAnirudhAppDataLocalTemppip-install-xer9o7awmysqlclient

我正在使用Visual Studio 2017,并按照下面的链接解决此问题,但没有运气。

https://dimitri.janczak.net/2017/05/20/python-3-6-visual-studio-2017/

我尝试使用 pip 安装mysqlclient。但我没有成功。我能够使用以下方法安装它:

conda install mysqlclient

它对我来说效果很好。

最新更新