python - 原始错误:导入运行时时 DLL 加载失败:
问题描述
我正在使用一个库(石榴),我希望它在 GPU 中运行,这需要安装 Cupy-CUDA。我已经使用 install cupy-cuda111 安装了它(根据这个文档,因为我的 CUDA 版本是 11.1)。
我在 " import cupy
" 行收到此错误,我不知道如何解决。
Traceback (most recent call last):
File "C:\Users\andrea\.virtualenvs\workspace-ee5hg7DR\lib\site-packages\cupy\__init__.py", line 16, in <module>
from cupy import _core # NOQA
File "C:\Users\andrea\.virtualenvs\workspace-ee5hg7DR\lib\site-packages\cupy\_core\__init__.py", line 1, in <module>
from cupy._core import core # NOQA
File "cupy\_core\core.pyx", line 1, in init cupy._core.core
File "C:\Users\andrea\.virtualenvs\workspace-ee5hg7DR\lib\site-packages\cupy\cuda\__init__.py", line 8, in <module>
from cupy.cuda import compiler # NOQA
File "C:\Users\andrea\.virtualenvs\workspace-ee5hg7DR\lib\site-packages\cupy\cuda\compiler.py", line 11, in <module>
from cupy.cuda import device
File "cupy\cuda\device.pyx", line 1, in init cupy.cuda.device
ImportError: DLL load failed while importing runtime: No se puede encontrar el módulo especificado.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\andrea\Desktop\workspace\train11.py", line 16, in <module>
import cupy as cp
File "C:\Users\andrea\.virtualenvs\workspace-ee5hg7DR\lib\site-packages\cupy\__init__.py", line 37, in <module>
raise ImportError(_msg) from e
ImportError: CuPy is not correctly installed.
If you are using wheel distribution (cupy-cudaXX), make sure that the version of CuPy you installed matches with the version of CUDA on your host.
Also, confirm that only one CuPy package is installed:
$ pip freeze
If you are building CuPy from source, please check your environment, uninstall CuPy and reinstall it with:
$ pip install cupy --no-cache-dir -vvvv
Check the Installation Guide for details:
https://docs.cupy.dev/en/latest/install.html
original error: DLL load failed while importing runtime: No se puede encontrar el módulo especificado.
那里说 Cupy 没有正确安装,但是我卸载并安装了两次,错误仍然存在。
蟒蛇= 3.9.7
CUDA = 11.1
Linux(使用 pipenv)
解决方案
推荐阅读
- javascript - 让我的 chrome 扩展程序将 iframe 的 URL 发送到 Google Analytics,而不是窗口 URL
- python - 在 networkx/matplotlib.pyplot/graphviz 中缩放子图?
- excel - 选择案例代码范围的最后一行代码
- javascript - 带有单击的javascript进度条
- angularjs - 在 720kb 日历上突出显示日期
- python-3.x - 将数据加载到 aws elasticsearch 时出错:RequestError(400, '没有为 uri [/:443/movies/_doc/5] 和方法 [PUT] 找到处理程序'
- oracle - ORA-32359: 无法为此查询指定 FRESH_MV 提示 - 查询 RTMV
- python - 在 cx_Oracle 中处理多个游标
- powershell - powershell:类括号内的逗号和参数?
- javascript - 我在反应应用程序中使用了 axios,但无法从提供的链接中获取用户数据