ImportError:导入 _SimpleITK 时 DLL 加载失败。找不到给定的模块

发布于 2025-01-15 15:31:03 字数 405 浏览 3 评论 0原文

我正在尝试使用通过 GitHub 提供的以下脚本:脚本。我安装了 python 3.9.10,pip 版本 22.0.4。但是当我运行 py script.py 时,我收到以下错误消息:“ImportError:导入 _SimpleITK 时 DLL 加载失败。找不到给定的模块”

我首先在下载 SimpleITK 时遇到问题,因为 CMake 可以不建造它,也不认识建造轮子。但现在似乎工作正常,我尝试使用不同版本的 SimpleITK(2.0.2 和 2.1.0),但都给了我相同的错误。

我还确保删除了任何其他版本的 python,因为我之前安装了 3.10,但这也没有解决任何问题。

I am trying to use the following script provided through GitHub: Script. I have python 3.9.10 installed, pip version 22.0.4. But when I run py script.py I get the following error message: "ImportError: DLL load failed while importing _SimpleITK. Can't find the given module"

I first had a problem downloading SimpleITK because CMake could not build it, or recognise the building wheel. But now that seems to work fine and I've tried using different versions of SimpleITK (2.0.2 and 2.1.0) but both give me the same error.

I also made sure to remove any other versions of python since I did have 3.10 installed before but that didn't solve anything either.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

止于盛夏 2025-01-22 15:31:03

我想我解决了这个问题,我不确定是哪个步骤做到了,但这就是我所做的。

c:\users\alexa\appdata\local\programs\python\python39\lib\site-packages 添加到环境变量中的 Path 中。这很可能是问题的根本原因。

(重新)安装了 Visual Studio 2022。

使用 pip 在终端中重新安装了 SimpleITK、scikit-build、CMake 和 numpy。

I think I solved the problem, I am not sure which of the steps did it but this is what I did.

Added c:\users\alexa\appdata\local\programs\python\python39\lib\site-packages to Path in environment variables. This is most likely the root cause of the problem.

(Re)Installed Visual Studio 2022.

Reinstalled SimpleITK, scikit-build, CMake and numpy in terminal with pip.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文