我已经安装了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正确安装模块。


当前回答

再加上乔杜里的回答:

在我的情况下,我得到了另一个关于lxml的错误如下:

copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win-amd64-3.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

我必须安装lxml - 4.2.3 - cp37 - cp37m - win_amd64。与Sushant Chaudhary的回答一样,成功完成Scrapy的安装。

下载lxml 4.2.3——cp37 cp37m——win_amd64。whl来自Lxml 把它放在Python安装的文件夹里 使用PIP Install <file-name>安装它

现在您可以运行pip install scrapy。

其他回答

如果Visual Studio不是你的东西,而你正在使用VS Code,那么这个链接将指导你通过安装程序让c++在你的Windows上运行。

您只需要完成先决条件部分。 https://code.visualstudio.com/docs/cpp/config-msvc/#_prerequisites

这与其他答案相似,但这个链接可能比这里的一些回答更陈旧。

PS:别忘了运行pip install——upgrade setuptools

安装spaCy模块时也遇到同样的问题。我检查了控制面板,我已经安装了几个Microsoft Visual c++的可重分发版本。

我选择了“Microsoft Visual Studio Community 2015”,它已经安装在我的电脑上→“修改”→勾选“Visual c++ 2015常用工具”。然后需要一些时间和下载超过1gb来安装它。

这解决了我的问题。现在我已经安装了spaCy。

要解决以下任何错误:

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

确保您已经安装了这些必需的软件包。当我安装检查包时,它在我的情况下完美地工作:

使用这个可以节省时间

pip install pipwin 
pipwin install yourLibrary

pipwin类似于pip,但它安装由Christoph Gohlke提供的预编译的Windows二进制文件。节省了你大量的时间搜索和下载。

在这种情况下,pipwin会解决问题

Error: Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)

阅读更多关于pipwin的信息,这里他们提到了Microsoft Visual c++