我已经安装了Python 3.5,并且正在运行

pip install mysql-python

它给出了如下错误

错误:Microsoft Visual c++ 14.0是必需的(无法找到vcvarsall.bat)

我已经添加了以下行到我的路径

C:\Program Files\Python 3.5\Scripts\;
C:\Program Files\Python 3.5\;

C:\Windows\System32;
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC;
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC

我的电脑上安装了64位的Windows 7。

什么解决方案可以减少这个错误,并通过pip正确安装模块。


当前回答

我也有同样的问题。我需要一个64位版本的Python,所以我安装了3.5.0(撰写本文时最新的版本)。切换到3.4.3之后,我的所有模块安装都正常了。

Python Windows版本

其他回答

我只是在使用最新的Python 3.6时遇到了同样的问题。Windows OS 10家庭版和64位操作系统。

解决方法:

通过控制面板卸载任何版本的Visual Studio 安装Visual Studio 2015并选择将安装的默认选项 Visual c++ 14.0 您可以使用PyCharm安装Scrapy:菜单项目→项目解释器→+(安装Scrapy) 通过导入检查REPL和PyCharm中的Scrapy。您应该不会看到任何错误。

要解决以下任何错误:

misaka的车轮建造失败 建造misaka失败 需要Microsoft Visual c++ 14.0 无法找到vcvarsall.bat

解决方案是:

Go to Build Tools for Visual Studio 2017 Select free download under Visual Studio Community 2017. This will download the installer. Run the installer. Select what you need under workload tab: a. Under Windows, there are three choices. Only check Desktop development with C++. b. Under Web & Cloud, there are seven choices. Only check Python development (I believe this is optional, but I have done it). In cmd, type pip3 install misaka. Note if you already installed Visual Studio then when you run the installer, you can modify yours (click modify button under Visual Studio Community 2017) and do steps 3 and 4. Final note: If you don't want to install all modules, having the three below (or a newer version of the VC++ 2017) would be sufficient. (You can also install the Visual Studio Build Tools with only these options, so you don’t need to install Visual Studio Community Edition itself) => This minimal install is already a 4.5 GB, so saving off anything is helpful

我在安装pymssql时遇到了类似的情况。

pip试图构建这个包,因为Python 3.6和Windows没有正式的轮子。

我从非官方的Windows二进制for Python扩展包下载了一个非官方的轮子。

特别针对您的情况:MySQL-python

我也有同样的问题。下载Visual Studio 2017的构建工具对我有用。

对于Python 3.7.4,以下一组命令可以工作: 在执行这些命令之前,您需要确认Visual Studio中已经安装了Desktop with c++ and Python。

cd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build"
vcvarsall.bat x86_amd64
cd \
set CL=-FI"%VCINSTALLDIR%\tools\msvc\14.16.27023\include\stdint.h"
    
pip install pycrypto