Python error: command '…\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2

孤人 提交于 2019-11-27 21:37:09

问题


I have some problems with python 3 module installing. I'm trying to install mysql using pip :

python -m pip install mysql

for python 3.4.4 and here is the error I get:

error: command 'C:\\Program Files (x86\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2

here is a screenshot : screenshot of the error message

I had other problems with module installation before, and I solved those by installing Visual Studio C++ 2010

Btw, the installation of other modules are working just fine.

My specs : Windows 10 x64

Python 3.4.4 x86


回答1:


Do you have Connector installed? (See also here)

Download it here and install.

It can be due to you have x64 Windows, but mysql wants files to be in "Program Files (x86)" directory:

mklink /d "C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" "C:\Program Files\MySQL\MySQL Connector C 6.0.2\include"

If won't help, try other answers from that post




回答2:


Go to this site and download whl file (for example python3.7 and win64 should use mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl).

Then run this command:

python -m pip install C:\Users\%USER%\Desktop\mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl


来源:https://stackoverflow.com/questions/36377777/python-error-command-microsoft-visual-studio-10-0-vc-bin-cl-exe-failed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!