“导入错误:导入_openmp_helpers时DLL加载失败”?

罗素

我试图导入resample_img来自nilearn.image于使用重采样一些医疗图像。

import nibabel as nib
import nibabel.processing
from nilearn.image import resample_img

img = nib.load('./dicom_to_nifti.nii')
new_img = nibabel.processing.resample_to_output(img, (2, 2, 2))
new_img.to_filename('nifti_2_2_2')

但是,我不断收到此错误消息,提示它找不到sklearn模块?我已经通过安装了它pip install sklearn我什至尝试卸载所有内容并进行全新安装,但弹出同样的问题。我确定这是我做错了什么,还是包装有问题。

Traceback (most recent call last):
  File "convert.py", line 9, in <module>
    from nilearn.image import resample_img
    _check_module_dependencies()
  File "C:\Users\craig\AppData\Local\Programs\Python\Python38\lib\site-packages\nilearn\version.py", line 111, in _check_module_dependencies
    _import_module_with_version_check(
  File "C:\Users\craig\AppData\Local\Programs\Python\Python38\lib\site-packages\nilearn\version.py", line 60, in _import_module_with_version_check
    module = __import__(module_name)
  File "C:\Users\craig\AppData\Local\Programs\Python\Python38\lib\site-packages\sklearn\__init__.py", line 75, in <module>
    from .utils._show_versions import show_versions
  File "C:\Users\craig\AppData\Local\Programs\Python\Python38\lib\site-packages\sklearn\utils\_show_versions.py", line 12, in <module>
    from ._openmp_helpers import _openmp_parallelism_enabled
ImportError: DLL load failed while importing _openmp_helpers: The specified module could not be found.. Module "sklearn" could not be found. See http://nilearn.github.io/introduction.html#installation for installation information.
PS C:\Users\craig\Documents\Files\westmead_radiomics> python test.py
Traceback (most recent call last):
  File "test.py", line 3, in <module>
    from nilearn.image import resample_img
  File "C:\Users\craig\AppData\Local\Programs\Python\Python38\lib\site-packages\nilearn\__init__.py", line 72, in <module>
    _check_module_dependencies()
  File "C:\Users\craig\AppData\Local\Programs\Python\Python38\lib\site-packages\nilearn\version.py", line 111, in _check_module_dependencies
    _import_module_with_version_check(
  File "C:\Users\craig\AppData\Local\Programs\Python\Python38\lib\site-packages\nilearn\version.py", line 60, in _import_module_with_version_check
    module = __import__(module_name)
  File "C:\Users\craig\AppData\Local\Programs\Python\Python38\lib\site-packages\sklearn\__init__.py", line 75, in <module>
    from .utils._show_versions import show_versions
  File "C:\Users\craig\AppData\Local\Programs\Python\Python38\lib\site-packages\sklearn\utils\_show_versions.py", line 12, in <module>
    from ._openmp_helpers import _openmp_parallelism_enabled
ImportError: DLL load failed while importing _openmp_helpers: The specified module could not be found.. Module "sklearn" could not be found. See http://nilearn.github.io/introduction.html#installation for installation information.

有任何想法吗?

Wojciech

nilearn似乎要依靠sklearn问题来自导入时缺少_openmp_helpers.py文件pip查找位置sklearn

我有一个类似的解决方案,并通过降级sklearn到0.22以下来解决这需要从PyPI存储库中获取它:

https://pypi.org/project/scikit-learn/0.21.3/#files

这有点麻烦,因为我必须安装Python 3.7(最新版本似乎可以与sklearn 0.21.3一起使用)和C ++编译器来构建sklearn(但是您可以尝试使用.whl安装)。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Python 3.7 anaconda环境-导入_ssl DLL加载失败错误

导入cv2时DLL加载失败错误

导入PyQt5时DLL加载失败

导入cv2(opencv)时出现“ DLL加载失败”

导入matplotlib._png作为_png导入:错误:DLL加载失败:找不到指定的模块

Pyinstaller:导入错误:DLL加载失败:找不到指定的模块

python tensorflow导入dll加载失败

导入PySide2时,DLL加载失败,仅在调试时

PyQt5 Pyuic导入错误:DLL加载失败

DLL加载失败:导入scipy时找不到指定的模块

导入具有GPU支持的TensorFlow时DLL加载失败

导入matplotlib失败,出现DLL加载错误,但仅在spyder中

cx_Freeze ImportError:导入_ctypes时,DLL加载失败失败:找不到指定的模块

导入张量流时出现“ ImportError:DLL加载失败”

Jupyter Notebook无法启动(导入错误:导入时DLL加载失败)

使用PyInstaller时出现“ ImportError:导入时DLL加载失败”

收到错误“ DLL加载失败:找不到指定的模块”。在尝试使用PyCharm在Anaconda中导入Windows的Tensorflow时

无法导入Orekit-“ DLL加载失败”

导入错误:DLL加载失败:使用cxfreeze时找不到指定的模块

导入错误:DLL 加载失败:找不到指定的模块。在尝试导入 TensorFlow 时

ElastAlert 导入错误:DLL 加载失败:找不到指定的程序

Pyinstaller 导入错误:DLL 加载失败:找不到指定的模块

带有 conda 的 PyCharm 中的“导入错误:DLL 加载失败”:如何自动导入 conda 的 PATH?

尝试安装 TensorFlow-GPU...因导入错误而失败:DLL 加载失败:找不到指定的模块

如何修复“导入错误:DLL 加载失败:找不到指定的过程”。在导入 tensorflow-gpu 时?

如何在python中的“导入错误:导入时DLL加载失败”中找到哪个DLL失败?

导入 QCustomPlot2 导入错误:DLL 加载失败:找不到指定的程序

如何修复“导入 QtWidgets 时 DLL 加载失败”?

从 sklearn 导入“kfold”时出现“DLL 加载失败:找不到指定的模块”错误