导入pytorch microsoft visual C++ Redistributable 时未安装

Kan*_*bot 3 python pytorch

我在带有 GPU 的 Windows 机器上工作。我已经在 conda 环境中安装了 pytorch

conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
Run Code Online (Sandbox Code Playgroud)

然后我运行 python 并在 python 内部执行 import torch 并收到此错误

           Python 3.6.10 |Anaconda, Inc.| (default, May  7 2020, 19:46:08) [MSC v.1916 64 bit (AMD64)] on win32
                    Type "help", "copyright", "credits" or "license" for more information.     
>>> import torch       
Microsoft Visual C++ Redistributable is not installed, this may lead to the DLL load failure.  
It can be downloaded at https://aka.ms/vs/16/release/vc_redist.x64.exe                                 
Traceback (most recent call last):                                                                                       
 File "<stdin>", line 1, in <module>                                                                                     
File "C:\Users\aliag\anaconda3\envs\pytorchPractice\lib\site-packages\torch\__init__.py", line 127, in <module>           
raise err                                                                                                           
OSError: [WinError 126] ??????????????????? 
Error loading "C:\Users\aliag\anaconda3\envs\pytorchPractice\lib\site-packages\torch\lib\asmjit.dll" 
or one of its dependencies.                                                 
>>> 
Run Code Online (Sandbox Code Playgroud)

我该如何纠正这个错误?

Ric*_*hez 11

从错误中的链接获取 Microsoft Visual C++ Redistributable 安装程序,在这种情况下是这个. 运行安装程序并在完成后再次启动配置 conda 的 shell