简体   繁体   中英

“pip install mysqlclient” throws error: Unable to find vcvarsall.bat

I am trying to install the mysqlclient module in python 2.7. Using pip and easy_install give the following error

> easy_install mysqlclient


Searching for mysqlclient
Reading https://pypi.python.org/simple/mysqlclient/
Best match: mysqlclient 1.3.12
Downloading https://files.pythonhosted.org/packages/6f/86/bad31f1c1bb0cc99e88ca2
adb7cb5c71f7a6540c1bb001480513de76a931/mysqlclient-1.3.12.tar.gz#sha256=2d9ec33d
e39f4d9c64ad7322ede0521d85829ce36a76f9dd3d6ab76a9c8648e5
Processing mysqlclient-1.3.12.tar.gz
Writing c:\users\home\appdata\local\temp\easy_install-9oa3ct\mysqlclient-1.3.12\
setup.cfg
Running mysqlclient-1.3.12\setup.py -q bdist_egg --dist-dir c:\users\home\appdat
a\local\temp\easy_install-9oa3ct\mysqlclient-1.3.12\egg-dist-tmp-kxvslf
error: Setup script exited with error: Unable to find vcvarsall.bat

The same error also with pip. I understand that some modules contain C code and need to be compiled before installation so i installed Microsoft Visual C++ Compiler for Python and added the location of vcvarsall.bat to a new system environmental variable VS90COMNTOOLS (Other answers show that this is where pip searches for the location of vcvarsall.bat) but i am still getting the same error.

Do i need to add it's path somewhere else? Where do pip and easy_install search for the file before starting compilation? How do i resolve this error?

为我解决的是使用:

pip install --only-binary :all: mysqlclient

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