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

安装tgcrypto时构建wheel失败,已装编译工具仍报错

解决tgcrypto安装时wheel构建失败问题

问题重现

error: subprocess-exited-with-error

× Building wheel for tgcrypto (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [19 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-312
creating build\lib.win-amd64-cpython-312\tests
copying tests_init_.py -> build\lib.win-amd64-cpython-312\tests
creating build\lib.win-amd64-cpython-312\tests\cbc
copying tests\cbc\test_cbc.py -> build\lib.win-amd64-cpython-312\tests\cbc
copying tests\cbc_init_.py -> build\lib.win-amd64-cpython-312\tests\cbc
creating build\lib.win-amd64-cpython-312\tests\ctr
copying tests\ctr\test_ctr.py -> build\lib.win-amd64-cpython-312\tests\ctr
copying tests\ctr_init_.py -> build\lib.win-amd64-cpython-312\tests\ctr
creating build\lib.win-amd64-cpython-312\tests\ige
copying tests\ige\test_ige.py -> build\lib.win-amd64-cpython-312\tests\ige
copying tests\ige_init_.py -> build\lib.win-amd64-cpython-312\tests\ige
running build_ext
building 'tgcrypto' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for tgcrypto
Failed to build tgcrypto
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (tgcrypto)

解决方案

  • 确认构建工具组件完整性
    打开Microsoft Visual Studio Installer,检查是否勾选了「Desktop development with C++」工作负载,同时确保该工作负载下的「MSVC v142及以上版本生成工具」、对应系统版本的「Windows SDK」已安装。如果组件不全,点击「修改」补充安装后重启电脑。

  • 手动加载编译环境变量
    以管理员身份启动命令提示符(CMD)或PowerShell,运行对应Visual Studio版本的环境配置脚本(以VS2022社区版为例):

    "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
    

    脚本执行完成后,在同一个窗口中运行pip install tgcrypto。

  • 使用预编译wheel包安装
    直接下载对应Python版本(如3.12)和系统架构(win_amd64)的tgcrypto预编译wheel文件,通过本地安装绕过编译步骤:

    pip install 本地wheel文件路径\tgcrypto-xxx-cp312-cp312-win_amd64.whl
    
  • 检查Python版本兼容性
    部分包对最新Python版本的支持可能滞后,若上述方法无效,可尝试降级到Python 3.11后再安装tgcrypto。

内容的提问来源于stack exchange,提问作者MOON MAN

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.21 08:17:25