小工具知识网

当前位置: 首页 > 行业知识 > 安装tiny-cuda-nn时报错RuntimeError: Could not locate a supported Microsoft Visual C++ installation

行业知识

安装tiny-cuda-nn时报错RuntimeError: Could not locate a supported Microsoft Visual C++ installation

2026-12-02 06:57:00 来源:互联网转载

问题描述

���照官方教程安装nerf studio,运行命令pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch安装tiny-cuda-nn时,出现以下报错:

× python setup.py egg_info did not run successfully.  │ exit code: 1  ╰─> [8 lines of output]      Traceback (most recent call last):        File "", line 2, in         File "", line 34, in         File "C:\Users\Lenovo\AppData\Local\Temp\pip-req-build-lz_n7l05\bindings/torch\setup.py", line 53, in           raise RuntimeError("Could not locate a supported Microsoft Visual C++ installation")      RuntimeError: Could not locate a supported Microsoft Visual C++ installation      Building PyTorch extension for tiny-cuda-nn version 1.7      Obtained compute capability 86 from PyTorch      [end of output]

根据报错,出现问题的原因是找不到Visual C++编译器的位置。

解决方法

参考链接:https://github.com/NVlabs/nvdiffrec/issues/35

Step1: 安装VS2019(已安装可跳过)

下载Visual Studio Installer

Visual Studio2019下载链接:https://visualstudio.microsoft.com/zh-hans/vs/older-downloads/

本人选择的是免费的Community版本:

勾选使用C++的桌面开发:

注意:如果安装的VS不是2017-2019版本,会出现以下报错:

Step2: 添加环境变量

右键此电脑->属性->高级系统设置->高级->环境变量

在系统变量Path中添加:G:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64 (按照自己的VS安装路径,我的安装路径是G:\Program Files (x86)\Microsoft Visual Studio)

上一篇:qq空间的模板怎么下载?

下一篇:揭秘房产门户网站背后的源码,揭秘核心技术与吸引力之源!