You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Python扩展模块编译时_PyGen_Send未解析外部符号错误排查求助

问题:运行Sibyl项目执行python setup.py develop时出现链接错误

环境信息

  • 目标项目:CMU-SAFARI/Sibyl
  • 触发命令:python setup.py develop
  • 当前配置:Cython 0.29.21、Visual Studio C++ Build Tools 2022
  • 已尝试操作:更换TensorFlow、pandas的不同版本

错误日志

Creating library build\\temp.win-amd64-cpython-310\\Release\\pandas\\_libs\\internals.cp310-win_amd64.lib and object build\\temp.win-amd64-cpython-310\\Release\\pandas\\_libs\\internals.cp310-win_amd64.exp
internals.obj : error LNK2001: unresolved external symbol _PyGen_Send
build\\lib.win-amd64-cpython-310\\pandas\\_libs\\internals.cp310-win_amd64.pyd : fatal error LNK1120: 1 unresolved externals
error: Setup script exited with error: command 'C\\\\Program Files (x86)\\\\Microsoft Visual Studio\\\\2022\\\\BuildTools\\\\VC\\\\Tools\\\\MSVC\\\\14.38.33130\\\\bin\\\\HostX86\\\\x64\\\\link.exe' failed with exit code 1120

解决方案

  • 升级Cython版本:Cython 0.29.21对Python 3.10的适配存在缺陷,_PyGen_Send符号的链接问题在后续版本中已修复。执行命令升级到兼容版本:pip install --upgrade cython(推荐0.29.30及以上或最新稳定版)
  • 核对Python版本兼容性:查看Sibyl项目的官方文档或requirements.txt,确认项目支持的Python版本。若项目未明确支持3.10,可尝试降级到Python 3.9后重新编译
  • 清理编译缓存重试:删除项目根目录下的build文件夹和*.egg-info文件夹,重新执行python setup.py develop,避免旧编译文件干扰
  • 用虚拟环境隔离依赖:创建独立虚拟环境安装依赖,避免全局环境版本冲突:
    python -m venv sibyl-venv
    # Windows激活命令
    sibyl-venv\Scripts\activate
    pip install -r requirements.txt
    python setup.py develop
    

内容的提问来源于stack exchange,提问作者Vishnu Vardhan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.04 19:16:21