【问题标题】:Python 2.7.9 install esmre with error 'cl.exe' failed with exit status 2Python 2.7.9 安装 esmre 时出现错误“cl.exe”失败,退出状态为 2
【发布时间】:2015-08-18 20:46:06
【问题描述】:

我使用的是 Windows 8 和 Python 2.7.9。我尝试使用pip 安装esmre,但出现以下错误:

src/aho_corasick.c(48) : 致命错误 C1083: 无法打开包含 文件:'stdbool .h':没有这样的文件或目录错误:命令 'C:\Users\CHALLEN QU\AppData\Local\Programs\Common\Micro soft\Visual C++ for Python\9.0\VC\Bin\cl.exe' 失败并退出 状态2

esmre 的造轮失败
构建 esmre 失败


我已经尝试过的事情:

  1. 为 Python 2.7 重新安装 Microsoft Visual C++ 编译器
  2. 升级pipsetuptools
  3. 寻找esmre的编译版本,我没找到
  4. 安装 esmreeasy_install 或包内的 setup.py。

好像编译不过来。

【问题讨论】:

    标签: python c++ python-2.7


    【解决方案1】:

    “stdbool.h”不是 C++ 标头和 Visual 2010 doesn't support C99

    作为一种解决方法,您可以找到 Visual 的“包含”目录并添加具有以下内容的“stdbool.h”文件:

    typedef int bool;
    #define false 0
    #define true 1
    

    this answer 中所述或

    #pragma once
    
    #define false   0
    #define true    1
    
    #define bool int
    

    来自this answer

    链接线程中的另一个解决方法是使用不同的编译器。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-16
      • 1970-01-01
      • 1970-01-01
      • 2016-07-22
      • 1970-01-01
      相关资源
      最近更新 更多