i’m tryng to import mysqlclient library for python with pip, when i use the command
pip install mysqlclient
it return an error:
JavaScript
x
43
43
1
Collecting mysqlclient
2
Using cached https://files.pythonhosted.org/packages/ec/fd/83329b9d3e14f7344d1cb31f128e6dbba70c5975c9e57896815dbb1988ad/mysqlclient-1.3.13.tar.gz
3
Installing collected packages: mysqlclient
4
Running setup.py install for mysqlclient error
5
Complete output from command c:usersastrinaappdatalocalprogramspythonpython36python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\astrina\AppData\Local\Temp\pip-install-40l_x_f4\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:UsersastrinaAppDataLocalTemppip-record-va173t5vinstall-record.txt --single-version-externally-managed --compile:
6
c:usersastrinaappdatalocalprogramspythonpython36libdistutilsdist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
7
warnings.warn(msg)
8
running install
9
running build
10
running build_py
11
creating build
12
creating buildlib.win-amd64-3.6
13
copying _mysql_exceptions.py -> buildlib.win-amd64-3.6
14
creating buildlib.win-amd64-3.6MySQLdb
15
copying MySQLdb__init__.py -> buildlib.win-amd64-3.6MySQLdb
16
copying MySQLdbcompat.py -> buildlib.win-amd64-3.6MySQLdb
17
copying MySQLdbconnections.py -> buildlib.win-amd64-3.6MySQLdb
18
copying MySQLdbconverters.py -> buildlib.win-amd64-3.6MySQLdb
19
copying MySQLdbcursors.py -> buildlib.win-amd64-3.6MySQLdb
20
copying MySQLdbrelease.py -> buildlib.win-amd64-3.6MySQLdb
21
copying MySQLdbtimes.py -> buildlib.win-amd64-3.6MySQLdb
22
creating buildlib.win-amd64-3.6MySQLdbconstants
23
copying MySQLdbconstants__init__.py -> buildlib.win-amd64-3.6MySQLdbconstants
24
copying MySQLdbconstantsCLIENT.py -> buildlib.win-amd64-3.6MySQLdbconstants
25
copying MySQLdbconstantsCR.py -> buildlib.win-amd64-3.6MySQLdbconstants
26
copying MySQLdbconstantsER.py -> buildlib.win-amd64-3.6MySQLdbconstants
27
copying MySQLdbconstantsFIELD_TYPE.py -> buildlib.win-amd64-3.6MySQLdbconstants
28
copying MySQLdbconstantsFLAG.py -> buildlib.win-amd64-3.6MySQLdbconstants
29
copying MySQLdbconstantsREFRESH.py -> buildlib.win-amd64-3.6MySQLdbconstants
30
running build_ext
31
building '_mysql' extension
32
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
33
34
----------------------------------------
35
Command "c:usersastrinaappdatalocalprogramspythonpython36python.exe -u -c "import setuptools,
36
tokenize;__file__='C:\Users\astrina\AppData\Local\Temp\pip-install-
37
40l_x_f4\mysqlclient\setup.py';f=getattr(tokenize, 'open', open)
38
(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code,
39
__file__, 'exec'))" install --record C:UsersastrinaAppDataLocalTemppip-
40
record-va173t5vinstall-record.txt --single-version-externally-managed --
41
compile" failed with error code 1 in C:UsersastrinaAppDataLocalTemppip-
42
install-40l_x_f4mysqlclient
43
I’ve already installed Microsoft Build Tools 2015 but the problem persist
Advertisement
Answer
First install python 3.6.5, then run
JavaScript
1
2
1
pip install mysqlclient==1.3.12
2