Python Forum
please help me to install mysqlclient!!!
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
please help me to install mysqlclient!!!
#1
i am having trouble,
when i inter 'pip install mysqlclient'
then it responce:

Collecting mysql
Downloading https://files.pythonhosted.org/packages/...0.2.tar.gz
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/...4.6.tar.gz
Installing collected packages: mysqlclient, mysql
Running setup.py install for mysqlclient ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\user\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-k8rfsl15\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-k8rfsl15\\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\user\AppData\Local\Temp\pip-record-b1l34o67\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\user\AppData\Local\Temp\pip-install-k8rfsl15\mysqlclient\
Complete output (24 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.9\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win-amd64-3.9\MySQLdb
copying MySQLdb\compat.py -> build\lib.win-amd64-3.9\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.9\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.9\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.9\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.9\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.9\MySQLdb
creating build\lib.win-amd64-3.9\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.9\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.9\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.9\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.9\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.9\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.9\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\user\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-k8rfsl15\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-k8rfsl15\\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\user\AppData\Local\Temp\pip-record-b1l34o67\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
Reply
#2
As noted in the docs:
NOTE: Wheels for Windows may be not released with source package. You should pin version in your requirements.txt to avoid trying to install newest source package.

the best would be to download wheel from gohlke and install it
https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Pip install for mysqlclient not working burvil 4 50,624 Feb-04-2021, 08:16 PM
Last Post: nilamo
  Can't install mysqlclient on mac Gabn123 5 4,787 Dec-25-2019, 06:54 AM
Last Post: Larz60+
  mysqlclient gregbarsd 0 3,973 Sep-26-2018, 05:55 AM
Last Post: gregbarsd

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020