ImportError:导入 _SimpleITK 时 DLL 加载失败。找不到给定的模块
我正在尝试使用通过 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想我解决了这个问题,我不确定是哪个步骤做到了,但这就是我所做的。
将
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.