Python 2.7.9安装esmre时出错'cl.exe文件'失败,退出状态为2

2024-10-01 09:22:48 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用的是Windows8和Python2.7.9。我试图用pip安装esmre,但出现以下错误:

src/aho_corasick.c(48) : fatal error C1083: Cannot open include file: 'stdbool .h': No such file or directory error: command 'C:\Users\CHALLEN QU\AppData\Local\Programs\Common\Micro soft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2

Failed building wheel for esmre
Failed to build esmre


我已经尝试过:

  1. 为Python 2.7
  2. 重新安装微软Visual C++编译器
  3. 升级pip和{}
  4. 查找esmre的编译版本,但我没有找到它
  5. 使用easy_install或设置.py在包裹里面。在

看来我就是不能编译它。在


Tags: pipsrcfor错误errorfilevisualfailed
1条回答
网友
1楼 · 发布于 2024-10-01 09:22:48

“StdBoo.h”不是C++头,而是Visual 2010 doesn't support C99。在

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

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

this answer

^{pr2}$

来自this answer。在

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

相关问题 更多 >