Python 需要 Microsoft Visual C++ 14.0(无法找到 vcvarsall.bat)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29846087/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)
提问by Umanda
I've installed Python 3.5 and while running
我已经安装了 Python 3.5 并且在运行时
pip install mysql-python
it gives me the following error
它给了我以下错误
error: Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)
I have added the following lines to my Path
我已将以下几行添加到我的路径中
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
I have a 64bit win 7 setup in my PC.
我的 PC 中有 64 位 win 7 设置。
What could be the solution for mitigating this error and installing the modules correctly via pip
.
减轻此错误并通过pip
.
回答by David Braun
I had the same problem. I needed a 64-bit version of Python so I installed 3.5.0 (the most recent as of writing this). After switching to 3.4.3 all of my module installations worked.
我有同样的问题。我需要一个 64 位版本的 Python,所以我安装了 3.5.0(撰写本文时的最新版本)。切换到 3.4.3 后,我的所有模块安装都有效。
回答by davidsheldon
Your path only lists Visual Studio 11 and 12, it wants 14, which is Visual Studio 2015. If you install that, and remember to tick the box for Languages->C++
then it should work.
您的路径仅列出 Visual Studio 11 和 12,它需要 14,即Visual Studio 2015。如果你安装了它,并记得勾选方框,Languages->C++
那么它应该可以工作。
On my Python 3.5 install, the error message was a little more useful, and included the URL to get it from
在我的 Python 3.5 安装中,错误消息更有用一点,并且包含了从中获取它的 URL
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
Edit: New working link
编辑:新的工作链接
Edit: As suggested by Lightfire228, you may also need to upgrade setuptools
package for the error to disappear:
编辑:根据 Lightfire228 的建议,您可能还需要升级setuptools
软件包才能使错误消失:
pip install --upgrade setuptools
回答by u1516331
I had the same problem when installing spaCy module. And I checked control panel I have several visual C++ redistributables installed already.
安装 spaCy 模块时我遇到了同样的问题。我检查了控制面板,我已经安装了几个可视化 C++ 可再发行组件。
What I did was select "Microsoft Visual Studio Community 2015" which is already installed on my PC --> "Modify" -->check "Common Tools for Visual C++ 2015". Then it will take some time and download more than 1 GB to install it.
我所做的是选择已安装在我的 PC 上的“Microsoft Visual Studio Community 2015”-->“修改”-->选中“Visual C++ 2015 的常用工具”。然后需要一些时间并下载超过 1 GB 来安装它。
This fixed my issue. Now I have spaCy installed.
这解决了我的问题。现在我安装了 spaCy。
回答by Sandeep Anand
Just had the same issue while using the latest Python 3.6. With Windows OS 10 Home Edition and 64 Bit Operation System
在使用最新的 Python 3.6 时遇到了同样的问题。使用 Windows OS 10 家庭版和 64 位操作系统
Steps to solve this issue :
解决此问题的步骤:
- Uninstall any versions of Visual studio you have had, through Control Panel
- Install Visual Studio 2015 and chose the default option that will install Visual C++ 14.0 on its own
- You can use Pycharm for installing scrapy ->Project->Project Interpreter->+ (install scrapy)
- check scrapy in REPL and pycharm by import , you should not see any errors
- 通过控制面板卸载您拥有的任何版本的 Visual Studio
- 安装 Visual Studio 2015 并选择将自行安装 Visual C++ 14.0 的默认选项
- 可以使用Pycharm安装scrapy ->Project->Project Interpreter->+(安装scrapy)
- 通过 import 在 REPL 和 pycharm 中检查 scrapy,您不应该看到任何错误
回答by Franck Dernoncourt
As the other responses pointed out, one solution is to install Visual Studio 2015. However, it takes a few GBs of disk space. One way around is to install precompiled binaries. The webpage http://www.lfd.uci.edu/~gohlke/pythonlibs(mirror) contains precompiled binaries for many Python packages. After downloading the package of interest to you, you can install it using pip install
, e.g. pip install mysqlclient?1.3.10?cp35?cp35m?win_amd64.whl
.
正如其他回复所指出的,一种解决方案是安装 Visual Studio 2015。但是,它需要几 GB 的磁盘空间。一种解决方法是安装预编译的二进制文件。网页http://www.lfd.uci.edu/~gohlke/pythonlibs( mirror) 包含许多 Python 包的预编译二进制文件。下载您感兴趣的软件包后,您可以使用 安装它pip install
,例如pip install mysqlclient?1.3.10?cp35?cp35m?win_amd64.whl
。
回答by ocean800
回答by Yonti
had a similar situation installing pymssql
安装pymssql有类似情况
pip was trying to build the package because there were no official wheels
for python 3.6 & windows.
pip 正在尝试构建包,因为
python 3.6 和 windows没有官方轮子。
solved it by downloading an unoffical wheel from here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
通过从这里下载一个非官方的轮子来解决它:http://www.lfd.uci.edu/~gohlke/pythonlibs/
specifically for your case -> http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python
专门针对您的情况-> http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python
回答by user3661384
I had this same problem. A solution for updating setuptools
我有同样的问题。更新 setuptools 的解决方案
pip install -U setuptools
or
或者
pip install setuptools --upgrade
回答by Sushant Chaudhary
I had the exact issue while trying to install Scrapy web scraping Python framework on my Windows 10 machine. I figured out the solution this way:
我在尝试在我的 Windows 10 机器上安装 Scrapy 网络抓取 Python 框架时遇到了确切的问题。我是这样想出解决方案的:
Download the latest(the last one) wheel file from this link wheel file for twistedpackage
I'd recommend saving that wheel file in the directory where you've installed Python i.e somewhere in Local Disk C
Then visit the folder where the wheelfile exists and run
pip install <*wheel file's name*>
Finally run the command
pip install Scrapy
again and you're good to use Scrapy or any other tool which required you to download massive Windows C++ Package/SDK.
我建议将该轮文件保存在您安装 Python 的目录中,即本地磁盘 C 中的某处
然后访问wheel文件所在的文件夹并运行
pip install <*wheel file's name*>
最后
pip install Scrapy
再次运行该命令,您就可以使用 Scrapy 或任何其他需要下载大量Windows C++ Package/SDK 的工具。
Disclaimer: This solution worked for me while trying to install Scrapy, but I can't guarantee the same happening while installing other softwares/packages/etc.?
免责声明:此解决方案在尝试安装Scrapy 时对我有用,但我不能保证在安装其他软件/包/等时也会发生同样的情况?
回答by Shashank Singh
Oops! Looks like they don't have Windows wheels on PyPI.
哎呀!看起来他们在PyPI上没有 Windows 轮子。
In the meantime, installing from source probably works or try downloading MSVC++ 14 as suggested in the error message and by others on this page.
与此同时,从源代码安装可能会起作用,或者按照错误消息和本页其他人的建议尝试下载 MSVC++ 14。
Christoph's sitealso has unofficial Windows Binaries for Python Extension Packages (.whl files).
Christoph 的站点也有用于 Python 扩展包的非官方 Windows 二进制文件(.whl 文件)。
Follow steps mentioned in following links to install binaries :
按照以下链接中提到的步骤安装二进制文件:
Also check :
还要检查: