0

I have created a sample Django application on Window 7 and I'm using Python V3.6 and Django 2.1 for this application we planned to use Mysql database. SO I have tried to install by the command 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',
    }
}

Do I need to install any SDK to resolve this?

SethuNagaKarthik
  • 387
  • 1
  • 3
  • 17
  • Well you need a MySQL server (and client), usually these will install the header files (at least on Linux, this will be installed). RIght now it can not "link" the calls to the relevant library. – Willem Van Onsem Aug 17 '18 at 13:08
  • There [are wheels available](https://pypi.org/project/mysqlclient/1.3.12/#files) for the previous release 1.3.12. You can install it with `pip install "mysqlclient==1.3.12"`. – Alasdair Aug 17 '18 at 13:12
  • @Alasdair thanks the "mysqlclient" installed successfully but after that when I tried to run my application I'm getting this "Unhandled exception in thread started by .wrapper at 0x0000000003B5B400> Traceback (most recent call last):" Do you have any idea about this? – SethuNagaKarthik Aug 17 '18 at 13:18
  • We can't help you unless you [edit] the question and include the full traceback. If `mysqlclient` installed correctly then it sounds like might be an unrelated issue, so it doesn't belong on this question. – Alasdair Aug 17 '18 at 13:20
  • OK sure will update this with new one. – SethuNagaKarthik Aug 17 '18 at 13:21

0 Answers0