简体   繁体   中英

Error while installing mysqlclient for python in Windows 10

I use this command for installing MySQL client: pip install mysqlclient

And then I see this problem:

running build_ext

building '_mysql' extension

error: Microsoft Visual C++ 10.0 is required. Get it with "Microsoft Windows SDK 7.1": www.microsoft.com/download/details.aspx?id=8279


Cleaning up... Command C:\\Python34\\python.exe -c "import setuptools, tokenize; file ='C:\\Users\\Jayed\\AppData\\Local\\Temp\\pip_build_Jayed\\mysqlclient\\setup.py';exec(compile(getattr(tokenize, 'open', open)( file ).read().replace('\\r\\n', '\\n'), file , 'exec'))" install --record C:\\Users\\Jayed\\AppData\\Local\\Temp\\pip-l4c6dhkk-record\\install-record.txt --single-version-externally-managed --compile failed with error code 1 in C:\\Users\\Jayed\\AppData\\Local\\Temp\\pip_build_Jayed\\mysqlclient Storing debug log for failure in C:\\Users\\Jayed\\pip\\pip.log

Actually I went down this path. While I suppose you can find all the libraries and components you need to get the client to compile, it is telling you it can't find a compiled copy of the client and is trying to compile it to install it.
Follow the instructions here: https://pypi.org/project/mysqlclient/ (it has notes about windows doing what you are describing) or download the wheel file (from downloads link on the page) and type

pip install mysqlclient.whl

and it will install without demanding C++ in order to use mysql with python.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM