when importing pytorch microsoft visual C++ Redistributable is not installed(导入pytorch microsoft visual C++ Redistributable 时未安装)
问题描述
我在带有 GPU 的 Windows 机器上工作.我已经在 conda 环境中安装了 pytorch
I work in a windows machine with GPU. I have installed pytorch in a conda environment with
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
然后我运行 python 并在 python 内部执行 import torch 并收到此错误
then I run python and inside of python I do import torch and I get this error
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:Usersaliaganaconda3envspytorchPracticelibsite-packages orch\__init__.py", line 127, in <module>
raise err
OSError: [WinError 126] 指定されたモジュールが見つかりません。
Error loading "C:Usersaliaganaconda3envspytorchPracticelibsite-packages orchlibasmjit.dll"
or one of its dependencies.
>>>
我该如何纠正这个错误?
How can I correct this error?
推荐答案
从错误中的链接获取 Microsoft Visual C++ Redistributable 安装程序,在本例中为 这个.运行安装程序并在完成后再次启动配置 conda 的 shell
Get the Microsoft Visual C++ Redistributable installer from the link in the error, in this case is this. Run the installer and launch again your shell with conda configured when finished
这篇关于导入pytorch microsoft visual C++ Redistributable 时未安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:导入pytorch microsoft visual C++ Redistributable 时未安装


基础教程推荐
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- 筛选NumPy数组 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01