django无法建立mysqlclient

时间:2018-08-17 13:07:09

标签: python mysql django

我已经在 Window 7 上创建了一个示例Django应用程序,并且我为此应用程序使用了 Python V3.6 Django 2.1 计划使用Mysql数据库。因此,我尝试通过命令pip install django mysqlclient

安装
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\ccduce\appdata\local\continuum\miniconda3\python.exe -u -c "import setuptoo
ls, tokenize;__file__='C:\\Users\\ccduce\\AppData\\Local\\Temp\\pip-install-dw406d2r\\mysqlclient\\setup.py';f=getatt
r(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'
))" install --record C:\Users\ccduce\AppData\Local\Temp\pip-record-je8ir8xy\install-record.txt --single-version-exter
nally-managed --compile:
    c:\users\ccduce\appdata\local\continuum\miniconda3\lib\distutils\dist.py:261: UserWarning: Unknown distribution o
ption: 'long_description_content_type'
      warnings.warn(msg)
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    copying _mysql_exceptions.py -> build\lib.win-amd64-3.6
    creating build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.6\MySQLdb\constants
    copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.6\MySQLdb\constants
    copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.6\MySQLdb\constants
    copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.6\MySQLdb\constants
    copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.6\MySQLdb\constants
    copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.6\MySQLdb\constants
    copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.6\MySQLdb\constants
    running build_ext
    building '_mysql' extension

    error: [WinError 3] The system cannot find the path specified: 'C:\\Program Files (x86)\\Microsoft Visual Studio
14.0\\VC\\PlatformSDK\\lib'

    ----------------------------------------
Command "c:\users\ccduce\appdata\local\continuum\miniconda3\python.exe -u -c "import setuptools, tokenize;__file__='C
:\\Users\\ccduce\\AppData\\Local\\Temp\\pip-install-dw406d2r\\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\ccduce\AppData\Local\Temp\pip-record-je8ir8xy\install-record.txt --single-version-externally-managed --compile"
 failed with error code 1 in C:\Users\ccduce\AppData\Local\Temp\pip-install-dw406d2r\mysqlclient\

Setting.py

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': '*****',
        'USER': '****',
        'PASSWORD': '******',
        'HOST': 'localhost',   # Or an IP Address that your DB is hosted on
        'PORT': '3306',
    }
}

我需要安装任何 SDK 来解决此问题吗?

0 个答案:

没有答案