错误:无法findvcvarsall.bat

我试图安装Python包德威 :

pip install dulwich 

但是我得到一个神秘的错误消息:

 error: Unable to find vcvarsall.bat 

如果我尝试手动安装包,也会发生同样的情况:

 > python setup.py install running build_ext building 'dulwich._objects' extension error: Unable to find vcvarsall.bat 

更新 :评论指出,这里的说明可能是危险的。 考虑使用Visual C ++ 2008 Express版本或针对Python的专用Microsoft Visual C ++编译器 ( 详细信息 ),而不要使用下面的原始答案。 原始错误信息意味着未安装所需的Visual C ++版本。


对于Windows安装:

运行setup.py以进行软件包安装时,Python 2.7将search已安装的Visual Studio 2008.您可以在调用setup.py之前,通过在VS90COMNTOOLS环境variables中设置正确的path来欺骗Python以使用更新的Visual Studio。

根据安装的Visual Studio版本执行以下命令:

  • Visual Studio 2010(VS10): SET VS90COMNTOOLS=%VS100COMNTOOLS%
  • Visual Studio 2012(VS11): SET VS90COMNTOOLS=%VS110COMNTOOLS%
  • Visual Studio 2013(VS12): SET VS90COMNTOOLS=%VS120COMNTOOLS%
  • Visual Studio 2015(VS14): SET VS90COMNTOOLS=%VS140COMNTOOLS%

警告:如下所述,如果您试图编译python模块,这个答案不太可能工作。

有关详细信息,请参阅在Windows上为Python 2.7构buildlxml 。

我find了解决scheme。 我有完全相同的问题,错误,安装“阿马拉”。 我已经安装了mingw32,但需要configurationdistutils。

  1. 我已经安装了Python 2.6。
  2. 我安装了mingw32到C:\programs\mingw\
  3. 将mingw32的bin目录添加到环境variables中:append c:\programs\MinGW\bin;PATH
  4. 编辑(如果不存在,创build)位于C:\Python26\Lib\distutils\distutils.cfg为:

     [build] compiler=mingw32 
  5. 现在运行easy_install.exe amara

确保通过打开一个新的cmd.exe来设置环境。

如果你想用Visual Studio C ++而不是mingw编译…

  1. 运行python.exe来显示编译的VC ++版本(示例如下)。

    由于distilutils的get_build_version防止混合版本( 每个Piotr的警告 ),所以使用Python编译的相应版本的Visual C ++编译器很重要

    • 黄色(顶部)是Python 2.7,用MSC v.1500(Visual Studio C ++ 2008)编译,
    • 红色(底部)是Python 3.4.1,用MSC v.1600(Visual Studio C ++ 2010)编译,

    显示使用MSC v.1600编译的使用MSC v.1500和Python 3.4.1编译的Python 2.7的命令行示例

  2. 使用下面的表格[1]来匹配内部VC ++版本和相应的Visual Studio版本:

     MSC v.1000 -> Visual C++ 4.x MSC v.1100 -> Visual C++ 5 MSC v.1200 -> Visual C++ 6 MSC v.1300 -> Visual C++ .NET MSC v.1310 -> Visual C++ .NET 2003 MSC v.1400 -> Visual C++ 2005 (8.0) MSC v.1500 -> Visual C++ 2008 (9.0) MSC v.1600 -> Visual C++ 2010 (10.0) MSC v.1700 -> Visual C++ 2012 (11.0) MSC v.1800 -> Visual C++ 2013 (12.0) MSC v.1900 -> Visual C++ 2015 (14.0) MSC v.1910 -> Visual C++ 2017 (15.0) 
  3. 从上一步下载并安装相应版本的Visual Studio C ++。
    下面列出了特定版本的VC ++的附加说明。

    注意Visual Studio C ++ 2008

    仅适用于32位编译器,请下载Visual Studio C ++ 2008 Express Edition 。

    对于64位编译器[2] [3] ,请下载Windows SDK for Windows 7和.NET Framework 3.5 SP1 。

    • 取消选中Developer Tools >> Visual C++ Compilers以外的所有内容,以便从安装SDK工具中节省时间和磁盘空间,否则您不需要这些工具。

    注意Visual Studio C ++ 2010

    据微软说,如果你安装了Visual Studio 2010 SP1,它可能已经删除了VC ++的编译器和库。
    如果是这种情况,请下载Visual C ++ 2010 SP1编译器更新 。

    注意Visual Studio C ++ 2015

    如果您不需要Visual Studio IDE,请下载Visual Studio C ++ 2015构build工具 。

    注意Visual Studio C ++ 2017

    如果您不需要Visual Studio IDE,请下载适用于Visual Studio 2017的构build工具 。

    build议 :如果你同时安装了32位和64位的Python,你也可以使用virtualenv来创build单独的Python环境,这样你就可以同时使用一个或另一个,而不会混淆你的path来select哪个Python版本使用。

根据@srodriguex的说法 ,您可以跳过手动加载浴文件(步骤2-4),而不是通过复制一些batch file到Python正在search的地方。 如果这不起作用,下面是最初为我工作的步骤。

  1. 打开一个cmd.exe

  2. 尝试安装需要C扩展名的东西之前 ,运行以下batch file以将VC ++编译器的环境加载到会话中(即环境variables,编译器的path等)。

    执行:

    • 32位编译器:

      注意 :如预期的那样,32位Windows安装将仅具有C:\Program Files\

      "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"

    • 64位编译器:

      "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\vsvars64.bat"

      注意 :是的,本机64位编译器位于Program Files (x86) 。 不要问我为什么。
      此外,如果您想知道vcvars64.batvcvarsx86_amd64.bat之间的vcvars64.bat ,或者更重要的是amd64x86_amd64之间的区别,前者适用于本机64位编译器工具,后者适用于64位交叉编译器在32位Windows安装上运行。

    更新:
    如果由于某种原因,你正在得到error: ... was unexpected at this time. 那里...是一些字符序列,那么你需要检查你的pathvariables没有任何额外的引号或杂散字符的无关字符。 batch file不能够更新您的会话path,如果它无法理解它的话。

  3. 如果顺利的话,你应该得到下面的消息之一,这取决于你使用哪个版本的VC ++和你运行的命令:

    对于32位编译器工具:
    Setting environment for using Microsoft Visual Studio 20xx x86 tools.

    对于64位编译器工具:
    Setting environment for using Microsoft Visual Studio 20xx x64 tools.

  4. 现在 ,通过python setup.py installpip install pkg-name运行pip install pkg-name

  5. 希望并且交叉你的手指,行星被正确地对准,VC ++合作。

这是怎么回事? Python模块可以用C或C ++编写 (通常用于速度)。 如果您尝试使用Pip(或setup.py )安装此类软件包,则必须从源代码编译该C / C ++。 出来的盒子,皮普将公然承担你的编译器Microsoft Visual C ++安装。 如果你没有,你会看到这个神秘的错误消息“错误:无法findvcvarsall.bat”。

规定的解决scheme是安装一个C / C ++编译器,Microsoft Visual C ++或MinGW (一个开源项目)。 但是,安装和configuration要么非常困难。 (2014年编辑:微软已经发布了Python 2.7的特殊C ++编译器 )

最简单的解决scheme是将Christoph Gohlke的Windows安装程序(.msi)用于stream行的Python软件包。 他为Python 2.x和3.x,32位和64位构build安装程序。 你可以从http://www.lfd.uci.edu/~gohlke/pythonlibs/下载它们;


如果你也认为“错误:无法findvcvarsall.bat”是一个可笑的和无用的消息,那么请评论http://bugs.python.org/issue2943上的错误,用一个更有帮助的,友好的信息。;

为了比较,Ruby提供了一个包pipe理器Gem,并提供了一个准官方的C / C ++编译器DevKit。 如果你尝试安装没有它的包,你会看到这个有用的友好的有用信息:

请更新您的PATH以包含构build工具或从http://rubyinstaller.org/downloads下载DevKit,并按照http://github.com/oneclick/rubyinstaller/wiki/Development-Kit

你可以在https://stackoverflow.com/a/13445719/284795上阅读关于Python包装的更长篇大论;

您将需要安装一个Microsoft编译器,与用于构buildPython的编译器兼容。 这意味着你需要Visual C ++ 2008(或更新的,有一些调整 )。

微软现在提供一个绑定的编译器和头文件,以便能够编译Python扩展,

Microsoft Visual C ++编译器for Python 2.7

http://aka.ms/vcpython27

这是一个相对较小的包装; 85MB下载,无需pipe理员权限即可安装,无需重启。 这个名字有一点误导,编译器可以用于任何最初用Visual C ++ 2008编译的Python版本,而不仅仅是Python 2.7。

如果启动Python交互提示或打印sys.version ,请查找MSC版本string; 如果是MSC v.1500 ,则可以使用此工具。

从最初的公告到distutils列表 :

微软已经发布了Python 2.7的编译器软件包,以方便人们在Windows上构build和分发他们的C扩展模块。 用于Python 2.7的Microsoft Visual C ++编译器(又名VC9)可从以下url获得: http : //aka.ms/vcpython27

这个软件包包含了构buildPython 2.7 32位和64位C扩展模块所需的所有工具和头文件(注意一些扩展模块需要第三方依赖项,例如OpenSSL或libxml2)。 也支持使用Visual C ++ 2008构build的其他版本的Python,所以“Python 2.7”只是广告 – 它能在2.6和3.2下正常工作。

请注意,您需要安装setuptools 6.0或更高版本(在下载页面上的系统要求中列出)。 您正在安装的项目必须使用setuptools.setup() ,而不是distutils或自动检测将无法正常工作。

微软已经表示,他们希望保持URL稳定,以便自动脚本可以轻松地引用它。

我只是有同样的问题,所以我会告诉我的故事,希望它能帮助别人解决同样的问题,并节省他们几个小时,

我有mingw(g ++(GCC)4.6.1)和python 2.7.3在Windows 7中,我试图安装PyCrypto。

运行setup.py install时,这一切都开始于这个错误:

 error: Unable to find vcvarsall.bat 

通过指定mingw作为select的编译器,在search错误后轻松解决:

 setup.py install build --compiler=mingw32 

问题是,然后我得到了一个不同的错误:

 configure: error: cannot run C compiled programs. 

事实certificate,我的防病毒阻止了新编译的.exe的执行。 我只是禁用了反病毒“驻地盾”,并去了下一个错误:

 cc1.exe: error: unrecognized command line option '-mno-cygwin' error: command 'gcc' failed with exit status 1 

解决了这个问题:“要么安装MinGW的稍旧版本,要么编辑distutils \ cygwinccompiler.py到你的Python目录中去除所有的-mno-cygwin实例。 (从这里 )

现在,我终于可以开始工作了。

看起来像在寻找VC编译器,所以你可以尝试用-c mingw32来提及编译器types,因为你有msys

 python setup.py install -c mingw32 

我有Python 2.73和Windows 7的解决scheme,为我工作是:

  1. 将mingw32的bin目录添加到环境variables中:将PATH附加到C:\programs\mingw\bin;
  2. 创build位于C:\Python27\Lib\distutils\distutils.cfg其中包含:

     [build] compiler=mingw32 

要处理MinGW不再识别-mno-cygwin标志,请删除C:\ Python27 \ Lib \ distutils \ cygwincompiler.py行中​​的标志322到326,所以它看起来像这样:

  self.set_executables(compiler='gcc -O -Wall', compiler_so='gcc -mdll -O -Wall', compiler_cxx='g++ -O -Wall', linker_exe='gcc', linker_so='%s %s %s' % (self.linker_dll, shared_option, entry_point)) 

查看你正在尝试安装的软件包的setup.py文件。 如果是较旧的软件包,则可能是导入distutils.core.setup()而不是setuptools.setup()

我遇到了这个问题(2015年),结合了这些因素:

  1. 来自http://aka.ms/vcpython27的Microsoft Visual C ++编译器for Python 2.7

  2. 一个使用distutils.core.setup()的旧版软件包

  3. 试图做python setup.py build而不是使用pip

如果使用最新版本的pip,它会强制(monkeypatch)包使用setuptools,即使它的setup.py调用distutils。 但是,如果您不使用pip,而只是在执行python setup.py build ,则构build过程将使用distutils.core.setup() ,它不知道编译器的安装位置。


步骤1:打开相应的Visual C ++ 2008命令提示符

打开“开始”菜单或“开始”屏幕,search“Visual C ++ 2008 32位命令提示符”(如果您的Python是32位)或“Visual C ++ 2008 64位命令提示符”(如果您的Python是64位) 。 运行。 命令提示符应该在标题栏中说Visual C ++ 2008 …。

第2步:设置环境variables

在刚刚打开的命令提示符中设置这些环境variables。

 SET DISTUTILS_USE_SDK=1 SET MSSdk=1 

参考http://bugs.python.org/issue23246

第3步:构build和安装

cd到你想要构build的包,运行python setup.py build ,然后python setup.py install 。 如果你想安装到virtualenv中,在构build之前激活它。

也许有人可能会感兴趣,以下工作为我py2exe包。 (我有Windows 7的64位和可移植的Python 2.7,与Windows SDK的Windows 7和.NET Framework 4的Visual Studio 2005 Express)

 set VS90COMNTOOLS=%VS80COMNTOOLS% 

然后:

 python.exe setup.py install 

我尝试了所有上述的答案,并发现他们都不工作,这也许是我正在使用Windows 8,并已安装Visual Studio 2012.在这种情况下,这是你所做的。

vcvarsall.bat文件位于: C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC

只需select文件,并复制它。

然后转到此目录: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools

并粘贴该文件。 然后,一切都会好的。

我花了近2天的时间搞清楚如何解决这个问题在我的Python 3.4 64位版本:Python 3.4.3(v3.4.3:9b73f1c3e601,2015年2月24日,22:44:40)[MSC v.1600 64位(AMD64 )]在win32上

解决scheme1,很难:(在阅读之前,先阅读下面的解决scheme2)最后,这是对我的帮助:

  1. 安装Visual C ++ 2010 Express
  2. 安装Windows 7的Microsoft Windows SDK v7.1
  3. C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64中手动创build文件vcvars64.bat ,其中包含CALL "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64或其他path,取决于你的安装位置
  4. (这似乎是可选的)安装Microsoft Visual Studio 2010 Service Pack 1与Microsoft Visual C ++ 2010 Service Pack 1编译器更新为Windows SDK 7.1
  5. 之后,我试图pip install numpy但收到以下错误:

     File "numpy\core\setup.py", line 686, in get_mathlib_info raise RuntimeError("Broken toolchain: cannot link a simple C program") RuntimeError: Broken toolchain: cannot link a simple C program 

    我在这个https://stackoverflow.com/a/23099820/4383472在;C:\Python34\Lib\distutils\msvc9compiler.py mfinfo改为None

  6. 终于pip install numpy命令后,我的avast防病毒试图干涉安装过程,但我很快禁用它

花了很长时间 – numpy编译几分钟,我甚至认为有错误,但最后一切都好。

解决scheme2,很简单:(我知道这个方法已经在高度投票的答案中被提及,但让我重复,因为它真的更容易)经过所有这些工作,我明白,对我来说最好的方法就是使用已经预编译的二进制文件将来自http://www.lfd.uci.edu/~gohlke/pythonlibs/ 。 有一个很小的机会,我将永远需要一些包(或一个包的版本),这个网站不包含。 安装过程也是这样快得多。 例如,要安装numpy

  1. 从该站点下载numpy‑1.9.2+mkl‑cp34‑none‑win_amd64.whl (如果你有Python 3.4 64位)
  2. 在命令提示符或PowerShell的安装与pip install numpy‑1.9.2+mkl‑cp34‑none‑win_amd64.whl (或文件的完整path,取决于如何打开命令提示符)

当我试图在我的Python 3.5上安装numpy库时遇到了这个问题。 解决scheme是安装VS2015。 我有VS2008,2012,2013,其中没有任何与Python 3.5兼容。 显然新版本的python依赖于较新版本的VS.

另外确保C ++ Common Tools与Visual Studio一起安装。

在这里输入图像描述

您可以从http://go.microsoft.com/?linkid=7729279下载免费的Visual C ++ 2008 Express Edition,它将在安装过程中设置VS90COMNTOOLS环境variables,因此可以使用兼容的编译器进行构build。

正如@PiotrDobrogost在评论中提到的那样,他对这个问题的回答详细解释了为什么Visual C ++ 2008是正确的东西,但随着Python的Windows构build移植到Visual Studio的新版本,这可能会改变: 构buildlxml对于Windows上的Python 2.7

在Windows 7 x64上使用Python 3.4.1时遇到了这个问题,不幸的是我需要的软件包没有合适的exe或轮子,我可以使用。 这个系统需要一些“解决方法”,详情如下(和底部的TLDR )。

使用上面的Jaxrtech的答案中的信息,我确定我需要Visual Studio C ++ 2010(sys.version返回MSC v.1600),所以我从他的答案安装Visual C ++ 2010 Express中,这是http://go.microsoft .com /?linkid = 9709949 。 我用更新安装了所有东西,但正如你在下面可以看到的,这是一个错误。 此时只应安装原始版本的Express(不更新任何内容)。

vcvarsall.bat现在已经出现,但安装包时出现了一个新的错误, query_vcvarsall raise ValueError(str(list(result.keys())))ValueError: [u'path'] 。 这个错误还有其他的stackoverflow问题,比如为Python 2.7创build/安装C模块时出错

我从这个答案确定2010 Express只安装32位编译器。 要获得64位(和其他)编译器,您需要安装Windows 7.1 SDK。 请参阅http://msdn.microsoft.com/en-us/windowsserver/bb980924.aspx

这不会为我安装,而安装程序返回错误installation failed with return code 5100 。 我在以下链接find解决scheme: http : //support.microsoft.com/kb/2717426 。 简而言之,如果安装了较新版本的x86和x64 Microsoft Visual C ++ 2010 Redistributable,它们将与SDK安装程序中的冲突,并需要先卸载。

SDK然后安装,但我注意到vcvars64.bat仍然不存在于C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin ,也没有它的子文件夹。 vcvarsall.bat运行vcvars64batch file,所以没有它,python包仍然不会安装(我忘记了这个时候显示的错误)。

然后,我在这里find了一些说明: http : //www.cryptohaze.com/wiki/index.php/Windows_7_Build_Setup#Download_VS_2010_and_Windows_SDK_7.1按照说明,我已经安装了Express和7.1 SDK,所以安装了SDK 7.1 SP1,并做了缺less头文件修复。 然后我手动创build了内容为CALL setenv /x64 vcvars64.bat。 我会在这里粘贴所有的指示,所以他们不会迷路。

第一步是下载Visual Studio Express 2010。

http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express是一个很好的开始。; 下载安装程序,并运行它(vc_web.exe)。 你不需要SQL 2008的额外下载。

您还需要64位编译器的Windows SDK(当前为7.1) – 除非您想要执行只支持32位版本(不完全支持)…

http://www.microsoft.com/en-us/download/details.aspx?id=8279是一个很好的开始下载这个; – 你会想下载winsdk_web.exe时运行!

这里的默认安装就好了。

最后,下载并安装Windows SDK 7.1 SP1更新: http : //www.microsoft.com/en-us/download/details.aspx?id=4422

并且,修复丢失的头文件,VS2010 SP1。 http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=75568aa6-8107-475d-948a-ef22627e57a5

而且,血腥的地狱,修复VS2010 Express缺less的batch file。 这是荒谬的。

在C:\ Program Files(x86)\ Microsoft Visual Studio 10.0 \ VC \ bin \ amd64中,使用以下命令创build“vcvars64.bat”(您将需要以pipe理员身份运行):

CALL setenv / x64

我的python包仍然没有安装(不记得错误)。 然后我发现了一些指令(复制如下)以使用特殊的SDK 7.1命令提示符,请参阅: https : //mail.python.org/pipermail/distutils-sig/2012-February/018300.html

没关系这个问题。 有人在这里注意到菜单上的这个项目:开始 – >所有程序 – > Microsoft Windows SDK v7.1 – > Windows SDK 7.1命令提示符

这将运行一个批处理作业,似乎为编译器设置了一个工作环境。 从该提示符下,您可以input“setup.py build”或“setup.py install”。

我按照指示打开了Windows SDK 7.1命令提示符,并用它在python包上运行easy_install。 最后,成功!


TLDR ;

  1. 安装Visual Studio Express 2010(最好没有更新的可再发行组件或SQL服务器)。
  2. 安装Windows 7.1 SDK
  3. Instal SDK 7.1 SP1 update, and VS2010 SP1 header file fix (this step may not be required).
  4. Manually create C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat with content CALL setenv /x64
  5. Start->All Programs->Microsoft Windows SDK v7.1 ->Windows SDK 7.1 Command Prompt to open special x64 command prompt, which can then be used with python/easy_install/pip/etc (including those in virtual_envs).

I wanted to run pysph on Windows 10 under Python 2.7 and got vcvarsall.bat was not found (from distutils)

My solution was the following:

Install Microsoft Visual C++ for Python 2.7 (like @Michael suggested)

On Windows 10 it was installed into (my username is Andreas):

 C:\Users\Andreas\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0 

Set environment variable VS90COMNTOOLS to the installation path of Visual C++ for Python 2.7 (see above path).

If it still doesn't work, then modifiy in the module

 C:/Python27/lib/distutils 

the file msvc9compiler.py . Find in it the function find_vcvarsall and do following modification.

Replace the line:

 productdir = os.path.join(toolsdir, os.pardir, os.pardir, "VC") 

 productdir = os.path.join(toolsdir) 

This is where vcvarsall.bat resides in my case (check, where vcvarsall.bat is in your installation).

I tried many solutions but only one worked for me, the install of Microsoft Visual Studio 2008 Express C++.

I got this issue with a Python 2.7 module written in C (yEnc, which has other issues with MS VS). Note that Python 2.7 is built with MS VS 2008 version, not 2010!

Despite the fact it's free, it is quite hard to find since MS is promoting VS 2010. Still, the MSDN official very direct links are still working: check https://stackoverflow.com/a/15319069/2227298 for download links.

If you have mingw installed

 pip install --global-option build_ext --global-option --compiler=mingw32 packagename 

works, forcing pip to build using the mingw compiler instead of Microsoft's. See here https://github.com/pypa/pip/issues/18 for details (last post).

Is Microsoft Visual C++ Compiler for Python 2.7 at http://www.microsoft.com/en-us/download/details.aspx?id=44266 not a solution?

The easiest way to solve this in 2016 is to install Chocolatey and then the vcpython27 package. Open Powershell:

 > iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) > choco install python2 -y > choco install vcpython27 -y 

You can use easy_install instead of pip it works for me.

I don't know if it is too late, but I found Microsoft Visual C++ Compiler for Python 2.7 which reads

The typical error message you will receive if you need this compiler package is Unable to find vcvarsall.bat

希望这可以帮助!

If you're looking to install pyodbc on a Windows box that doesn't have Visual Studio installed another option is to manually install pyodbc using the binary distribution.

This is particularly useful if you do not have administrator privileges on the machine you're working with and are trying to set up a virtualenv .

脚步:

  1. Download the latest Windows installer from here (pyodbc-XXXwin-Y-py2.7.exe)
  2. Open the installer executable using 7-Zip (or WinRAR or whatever)
  3. Extract pyodbc.pyd and pyodbc-XXX-py2.7.egg-info and place them in [python installation directory or virtualenv]\Lib\site-packages
  4. There is no step 4 🙂

With Python 3.4, the dependency is on Visual Studio 2010. Installing Visual C++ 2010 Express fixed the problem for me.

Tricking it into using the VS 2008 or 2013 installs that I happened to have didn't work.

The answer given by @monkey is one of the correct ones, but it is incomplete.

In case you'd like to use MinGW , you should select the C, C++ and also other development tools suggested during the MinGW installation process to also get "make.exe."

You must also have the path set to make.exe in the env.

To complete his answer, here are the steps:

  1. Add mingw32's bin directory to your environment variables
  2. Append C:\Programs\MinGW\bin;C:\Programs\MinGW\msys\1.0\bin; to the PATH
  3. Edit (create if it doesn't exist) the distutils.cfg file located at C:\Python26\Lib\distutils\distutils.cfg to be:

     [build] compiler=mingw32 

Make sure the environment variables is set by opening a new cmd.exe.

I had the same error (which I find silly and not really helpful whatsoever as error messages go) and continued having problems, despite having a C compiler available.

Surprising, what ended up working for me was simply upgrading pip and setuptools to the most recent version . Hope this helps someone else out there.

fastest solution :

If you have python 3.4.x , the solution is simply to install VC++ 2010 since it is used to compile itself into.

https://www.visualstudio.com/en-us/downloads#d-2010-express

my python version is MSC v.1600 32 bit (intel)] on win32

worked fine on Windows8

Go here: http://docs.continuum.io/anaconda/install.html#windows-install

There are instructions to install anaconda which will provide a GUI and a silent install of a majority of the packages that seem to be causing this issue from http://www.scipy.org/ . I am aware of the solution for 2.7 here https://www.microsoft.com/en-us/download/details.aspx?id=44266 but I did not see an option for Python 3.4. After downloading and installing Anaconda you should be able to import a majority of the packages you need from scipy.

Hope this helps some people. Took me 45 minutes of scouring posts and sites.

EDIT: Just wanted to note there is a Python34 link on the GUI page next to the OS symbols.

Install Visual Studio 2015 Community Edition from https://www.visualstudio.com , then

for Python 3.4

set VS100COMNTOOLS=%VS140COMNTOOLS% && pip install XX

Interesting Posts