需要 Microsoft Visual C++ 10.0(无法找到 vcvarsall.bat)

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

我尝试使用

在我的 Windows 8.1 上安装 ephem 模块
pip install ephem

但是我得到这个错误:

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

我正在使用 Python 3.4.3 请确切地告诉我我应该怎么做才能完成这项工作。我经历了很多解决方案,但对我没有帮助。

这几个:

Python Pip install Error: Unable to find vcvarsall.bat. Tried all solutions

我刚刚完成了以下步骤,并且能够通过 pip 安装扩展。我正在研究 Windows 8.1 x64。

  1. 使用 x86 安装程序安装最新的 Python 3 版本。 (x64 更难,因为 VS 不包含 x64 的编译器,请参阅第二个答案

  2. 安装可以从微软下载的Visual C++ Studio 2010 Express(按照this link,visual studio 2010下载在页面底部.您需要下载 C++ 版本,我认为您必须在 Microsoft 注册才能下载该软件)。

  3. 运行 py -3 -m pip install ephem 安装 ephem。 (py -3 -m pip 从您的 python 3 安装中调用 pip,如果您还安装了 python 2 会很有帮助)

对我来说没有任何问题。

2017 年更新:

请参阅以下 link,其中包含有关在 windows 上编译 python 的信息:

https://wiki.python.org/moin/WindowsCompilers

我遇到了同样的问题并在这里找到了最佳解决方案:http://www.devdungeon.com/content/fix-pip-install-unable-find-vcvarsallbat

它说:

Visual Studio 11, 12, and 14 are installed, but not 10. The error above specified it needed version 10. A newer version should work just as well, so let's just tell the environment to use the latest compiler instead of looking for version 10. In this case, 14 is the newest version. If you look at the pattern of the variable names, you can determine that the name for the version 10 should be VS100COMNTOOLS. You can set the version 10 variable to the value of version 14 with the following command: set VS100COMNTOOLS=%VS140COMNTOOLS%

所以,转到命令 window 和 运行 以下命令:

set "VS100COMNTOOLS=%VS140COMNTOOLS%"

希望对其他用户有所帮助。