我试图在Windows 10的虚拟环境中安装pytorch,我得到这个错误。
(test) C:\Users\Emmanuelle>py
Python 3.7.7 (default, May 6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see https://conda.io/activation
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Emmanuelle\Anaconda3\lib\site-packages\torch\__init__.py", line 81, in <module>
ctypes.CDLL(dll)
File "C:\Users\Emmanuelle\Anaconda3\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] Le module spécifié est introuvable
我该如何处理?
你的environment.assper有问题,errortraceback显示你的conda环境没有被激活,使用conda activate激活环境。
如果您使用的是 pipenv 或 virtualenv,那么请确保您使用 pip 下载 pytorch。