pip install mysqlclient错误django

时间:2018-08-06 22:49:08

标签: django python-3.x pip windows-10 mysql-connector-python

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

我发出了命令pip install mysqlclient,最后出现以下消息,安装被中止:

"c:\users\anirudh\appdata\local\programs\python\python36-32\python.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('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Anirudh\AppData\Local\Temp\pip-record-t3br6ckm\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Anirudh\AppData\Local\Temp\pip-install-xer9o7aw\mysqlclient\

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

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

1 个答案:

答案 0 :(得分:1)

我尝试使用pip安装mysqlclient。但是我没有成功。我可以使用以下方式安装它:

conda install mysqlclient

对我来说很好。

相关问题