使用 pip 安装 Twisted for Python:错误:Microsoft Visual Studio 失败,退出状态为 2

2024-02-26

当我尝试在运行 python3.7 的 Windows 10 计算机上安装 python 包 Twisted 时,我无法从 .tarz 文件构建 Wheel,最终得到以下输出:

C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWIN32=1 -Ic:\users\dario\appdata\local\programs\python\python37-32\include -Ic:\users\dario\appdata\local\programs\python\python37-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcsrc/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c /Fobuild\temp.win32-3.7\Release\src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.obj
iocpsupport.c
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(1933): warning C4047: '=': '__pyx_t_11iocpsupport_HANDLE' differs in levels of indirection from 'HANDLE'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(2077): warning C4022: 'CreateIoCompletionPort': pointer mismatch for actual parameter 1
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(2077): warning C4022: 'CreateIoCompletionPort': pointer mismatch for actual parameter 2
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(2077): warning C4047: '=': '__pyx_t_11iocpsupport_HANDLE' differs in levels of indirection from 'HANDLE'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(2192): warning C4022: 'GetQueuedCompletionStatus': pointer mismatch for actual parameter 1
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(2537): warning C4022: 'PostQueuedCompletionStatus': pointer mismatch for actual parameter 1
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(2648): warning C4022: 'CloseHandle': pointer mismatch for actual parameter 1
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7194): warning C4020: 'function through pointer': too many actual parameters
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7637): error C2039: 'exc_type': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7638): error C2039: 'exc_value': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7639): error C2039: 'exc_traceback': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7640): error C2039: 'exc_type': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7641): error C2039: 'exc_value': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7642): error C2039: 'exc_traceback': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7664): error C2039: 'exc_type': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7665): error C2039: 'exc_value': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7666): error C2039: 'exc_traceback': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7667): error C2039: 'exc_type': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7668): error C2039: 'exc_value': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7669): error C2039: 'exc_traceback': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7688): error C2039: 'exc_type': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7689): error C2039: 'exc_value': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7690): error C2039: 'exc_traceback': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7697): error C2039: 'exc_type': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7698): error C2039: 'exc_value': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7699): error C2039: 'exc_traceback': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7700): error C2039: 'exc_type': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7701): error C2039: 'exc_value': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7702): error C2039: 'exc_traceback': is not a member of '_ts'
c:\users\dario\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2

----------------------------------------
Command "c:\users\dario\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\dario\\AppData\\Local\\Temp\\pip-install-3p6tzbh6\\Twisted\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\dario\AppData\Local\Temp\pip-record-t02tl1qo\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\dario\AppData\Local\Temp\pip-install-3p6tzbh6\Twisted\

我已尝试以下方法来解决此问题:

  • 更新 Visual Studio 构建工具 2017
  • 更新 pip 和 setuptools
  • 在 Visual Studio 构建工具 2017 中安装 Windows 10 SDK
  • 从管理员命令提示符运行 pip
  • 从 Visual Studio x64 本机工具命令提示符运行 pip
  • 从该站点安装轮子:https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted它确实有效,但是当我运行 Scrapy 时,扭曲似乎是一个过时的版本,并且 python 3.7 存在语法错误

更新:Twisted 现在支持 Python 3.7


Twisted 尚不支持 Python 3.7。从here https://www.mail-archive.com/twisted-python@twistedmatrix.com/msg13025.html:

Twisted 尚不支持 Python 3.7。由于语法变化和 其他变化,以及构建基础设施不可用 此时此刻(例如,它在 Travis 上不起作用,我们还没有尝试过 appveyor),我们还不能完全识别问题所在并修复它 信心。

您可以跟踪他们对 Python 3.7 支持的进展.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使用 pip 安装 Twisted for Python:错误:Microsoft Visual Studio 失败,退出状态为 2 的相关文章

随机推荐

  • 在C中计算欧几里德距离矩阵

    我想将用 MATLAB 编写的代码转换为 C matrix 1 2 3 4 5 6 7 8 10 dis zeros 9 for i 1 3 for j 1 3 dis i j sqrt sum abs matrix i matrix j
  • 尝试从网络位置加载程序集,这会导致程序集被沙箱化

    Net 4 0 出现错误 尝试从网络位置加载程序集 会导致程序集被沙箱化 应用设置
  • 带有 IAM 的 AWS MSK - 超时异常

    我们正在使用 Aws MSK 最近他们宣布了 AWS MSK IAM AUTH https github com aws aws msk iam auth https github com aws aws msk iam auth 当我尝试
  • css动画为什么会改变z-index? [复制]

    这个问题在这里已经有答案了 为什么动画会改变 z index 如果您查看 jsfiddle 您会看到红色图像位于顶部 但如果注释掉动画 则蓝色图像位于顶部 即使有动画 如何才能使蓝色图像始终位于顶部 jsfiddle http jsfidd
  • 删除字符串中重复字符(单词)的最佳方法?

    删除字符串中任何重复字符和由空格分隔的字符集的最佳方法是什么 我认为这个例子更好地解释了这一点 foo h k k h2 h 应该变成 foo h k h2 order not important 其他例子 foo s s k become
  • 在 Windows 事件查看器中诊断 CLR 错误

    我们有一个 NET 桌面应用程序在生产中崩溃了 我们如何诊断错误 我想知道发生的异常类型 错误消息和堆栈跟踪 因为我们的代码没有处理异常 所以我们收到了 此应用程序遇到问题 需要关闭 Windows 消息框 唯一的选择就是关闭 没有调试按钮
  • 字符串匹配不同大小的 data.frames

    我有两个不同大小的 data frame 我正在寻找最有效的方法来将字符串从一个 data frame 匹配到另一个 data frame 并提取一些相关信息 这是一个例子 两个初始 data frames a 和 b 以及所需的结果 a
  • 如何使图像大小适应html表格中的行高

    我正在尝试制作一个强大的 html 签名以在 Thunderbird 中使用 我所说的稳健是指它不仅在 Thunderbird 中看起来正确 而且在我向其发送邮件的其他邮件客户端中也必须正确 例如 我使用 Gmail 进行了测试 布局非常简
  • ASP.Net Core 中的 AntiXSS

    Microsoft Web 保护库 AntiXSS https wpl codeplex com 已达到使用寿命 该页面指出 在 NET 4 0 中 框架中包含了一个 AntiXSS 版本 可以通过配置启用 在 ASP NET v5 中 基
  • PHP + Comet(长轮询)扩展/主机

    我使用 PHP MySQL 开发了一个应用程序 该应用程序使用了彗星技术 即长轮询 概念验证效果很好 但我预计流量会快速达到数千个同时连接 网络服务器上的数千个开放连接 我没有能力设置自己的服务器 例如使用 lighttpd 并且通常依赖简
  • 将自定义侦听器添加到 Kotlin 类的正确方法

    我是 Kotlin 菜鸟 第三天 正在尝试向我的班级添加一个侦听器 我目前正在使用 lambda 如下例所示 它们工作得很好 Declare callback class Controller var onAction gt Use cal
  • 有符号和无符号整数表达式的比较

    我刚刚开始使用 OpenGL 这是我的第一个代码 OpenGL hello program include
  • 如何确定复选框列表已选中/选中 -

    当我执行代码时 我得到 4 个复选框 并且我选中 选择了所有 4 个复选框 当我尝试调试代码时 它确实算作我有 4 个复选框 但所有 4 个复选框都被选中 false 我在代码中缺少什么
  • 检测项目中的循环依赖

    上次我在我的项目中发现了循环依赖问题 我解决了我的问题 但是我希望将来避免这种情况 我想到了在我的所有项目中发现循环依赖项并给我反馈的插件 Example 文件a js var functionFromA require b js cons
  • 如何增加 SwiftUI 选择器中显示的最大行数?

    我正在尝试创建一个 SwiftUI 选择器 用户可以使用它来选择 1000 到 20000 之间的数字 以 1000 为增量 例如 1000 2000 3000 20000 默认情况下 SwiftUI 选择器只能容纳 10 行文本 如何允许
  • 保存数据的最佳方法 - 首选项、sqlite、可序列化还是其他?

    我一直在研究在回合之间保存游戏数据的替代方法 并且想知道是否有人可以为我指明正确的方向 我有大约 32k 的数据必须在 onPause 期间保存 由于数据量巨大 我排除了偏好 我花了几天时间研究 SQLite 但无法在不到两秒的时间内保存数
  • Shellcode:执行 2 次 execve() 调用

    我正在尝试用汇编语言编写 shellcode 我需要执行一个 usr bin killall命令与 usr bin wget命令 我的两个命令都在 shellcode 中完美运行execve 系统调用 但现在我想将这两个结合起来 但这是不可
  • 在 Node.js 中从 SQLite 获取表列表

    下面的代码仅返回第一个表的名称 如何获取现有表中所有可用表名称的列表sqlite const sqlite3 require sqlite3 verbose const db new sqlite3 Database path to myd
  • 如何提高 OpenMP 代码的性能?

    我目前正在尝试提高我的代码的并行性能 但我对 OpenMP 仍然是新手 我必须迭代一个大容器 在每次迭代中从多个条目读取并将结果写入单个条目 下面是我正在尝试做的一个非常简单的代码示例 data是一个指向数组的指针 其中存储了许多数据点 在
  • 使用 pip 安装 Twisted for Python:错误:Microsoft Visual Studio 失败,退出状态为 2

    当我尝试在运行 python3 7 的 Windows 10 计算机上安装 python 包 Twisted 时 我无法从 tarz 文件构建 Wheel 最终得到以下输出 C Program Files x86 Microsoft Vis