问题描述
按照官方教程安装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 "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\Lenovo\AppData\Local\Temp\pip-req-build-lz_n7l05\bindings/torch\setup.py", line 53, in <module>
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版本,会出现以下报错:
文章来源:https://www.toymoban.com/news/detail-424588.html
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)
文章来源地址https://www.toymoban.com/news/detail-424588.html
到了这里,关于安装tiny-cuda-nn时报错RuntimeError: Could not locate a supported Microsoft Visual C++ installation的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!