简体   繁体   中英

Can't Install Python Libraries with C Dependencies

I'm currently running Python 3.4 on Windows 8.1 using PyCharm Community 5.0.3 and I've been running into the following error when I try to install libraries with C dependencies (ie pymssql):

error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat)

I've gone through various Stack Overflow responses to similar situations but haven't been able to find a viable answer as most of the questions are for Python 2.7. The main response I have found is to re-download Visual Studio 10, which I haven't been able to find at all on the web.

Any insight into this matter would be great.

First of all you can Download Microsoft Visual 2013 Redistributable Packages from this link

You can also use Mingw as a compiler for python 2.x and also for 3.x

check this documentation : https://docs.python.org/2.7/install/#gnu-c-cygwin-mingw

This allows you to have compiler to build your extensions for your python,to use mingw as a compiler for python you have to :

1-install mingw32 to **C:\\programs\\mingw**

2-Add mingw32's bin directory to your environment variable: append c:\\programs\\MinGW\\bin; to the PATH

3-Edit ( create if not existing ) distutils.cfg file located at C: \\Python2\\Lib\\distutils\\distutils.cfg to be:

[build]
compiler=mingw32

Now run easy_install.exe to install any module using c or c++ extensions :)

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