ImportError: DLL load failed, while file is in working directory

HarryMuesli

I'm trying to import scanpy for use in jupyter notebook with miniconda3. However, when I try to import scanpy, it gives an ImportError about the hdf5extension dll. When I look in the directory of the package tables though, I can see two files named hdf5.dll and hdf5extension.cp37-win_amd64.pyd (https://gyazo.com/a7d5a9d7d28756a8d82bc060b33b91ca). I assume that these are the files which should be imported, but I don't understand what's going wrong with the import.

I've used scanpy before on this system, but problems started showing up after I installed h5py via conda (not knowing that h5py is automatically included if you install scanpy via conda). So first I uninstalled h5py, which didn't work. Uninstalled and reinstalled miniconda3 twice, which did not work either. Setting the $PATH variable manually didn't help either.

So then I looked into the file.py which is referred to in the traceback, and figured that there should be a file in the tables directory. I found the files, and thought that maybe they were named wrongly, so I tried changing the name, which did not work either. Downgrading python from 3.7.1 to 3.6.6 didn't work, nor creating a new env in conda with python 3.6.6 and installing all the required packages.

Working on Windows 7 64-bit, with conda 4.5.12 with the miniconda3 installer.

> Python 3.6.6 | packaged by conda-forge | (default, Jul 26 2018, 11:48:23) [MSC v
.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

> import scanpy

> Traceback (most recent call last):

> File "", line 1, in File "C:\Miniconda3\envs\py36\lib\site-packages\scanpy\__init__.py", line 11, in 

> from . import tools as tl

> File "C:\Miniconda3\envs\py36\lib\site-packages\scanpy\tools\__init__.py", line 12, in <module>

> from .sim import sim

> File "C:\Miniconda3\envs\py36\lib\site-packages\scanpy\tools\sim.py", line 19, in <module>

> from .. import readwrite

> File "C:\Miniconda3\envs\py36\lib\site-packages\scanpy\readwrite.py", line 9,
in <module>

> import tables

> File "C:\Miniconda3\envs\py36\lib\site-packages\tables\__init__.py", line 131, in <module>

> from .file import File, open_file, copy_file

> File "C:\Miniconda3\envs\py36\lib\site-packages\tables\file.py", line 35, in <module>

> from . import hdf5extension

> ImportError: DLL load failed: The specified procedure could not be found.
McMillenundFrau

I had the very same problem you had, twice.

This seemed to be a Windows-specific problem. My first solution was to update my Visual Studio Version which comes with C-Build Tools that might be required to run scanpy in some way(?). This worked fine for some time.

A few weeks later I had the same ImportError again. This time the only thing that helped was to use an old version of h5py (2.8). Setting up a new Virtual Environment or resetting the Miniconda packages did not help, neither did specifying the hdf5-DLL save location as a windows variable.

My suggestion is that the new hdf5 libraries in h5py Version 2.9 are not yet compatible with the current C-Compilers from Microsoft VS.

Hope this helps!

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

"ImportError: DLL load failed while importing" while using PyInstaller

From Dev

"ImportError: DLL load failed while importing _openmp_helpers"?

From Dev

Jupyter notebook does not launch (ImportError: DLL load failed while importing)

From Python

ImportError: DLL load failed: The file cannot be accessed by the system

From Dev

ImportError: DLL load failed: The file cannot be accessed by the system

From Dev

How to find which DLL failed in "ImportError: DLL load failed while importing" in python?

From Dev

cx_Freeze ImportError: DLL load failed failed while importing _ctypes: The specified module could not be found

From Java

Import error: DLL load failed in Jupyter notebook but working in .py file

From Dev

How to resolve "ImportError: DLL load failed:" on Python?

From Dev

sklearn. ImportError: DLL load failed

From Dev

Pyinstaller ImportError with scipy: DLL load failed

From Dev

"ImportError: DLL load failed" when importing tensorflow

From Dev

Exception has occurred: ImportError DLL load failed while importing pdftotext: The specified module could not be found

From Dev

ImportError: DLL load failed while importing _psycopg: The specified module could not be found

From Dev

" ImportError: DLL load failed: The specified procedure could not be found"- while Digit Recognition using CNN in Python using Keras

From Dev

ImportError: DLL load failed while importing pyexpat: The specified module could not be found

From Dev

How to fix "ImportError: DLL load failed" while importing win32api

From Dev

Pyinstaller ImportError : DLL load failed while importing win32gui

From Dev

ImportError: DLL load failed: The specified module could not be found. While attempting to import TensorFlow

From Dev

How to fix 'ImportError: DLL load failed: The specified procedure could not be found.' while importing tensorflow-gpu?

From Dev

(ibm_db) ImportError: DLL load failed while importing ibm_db: The specified module could not be found

From Dev

ImportError: DLL load failed while importing QtWebKit: Le module spécifié est introuvable

From Python

Cannot import from pywinauto: ImportError: DLL load failed while importing win32ui: A dynamic link library (DLL) initialization routine failed

From Dev

TensorFlow Error: ImportError: DLL load failed with error code 3221225501 while importing _pywrap_ tensorflow_internal in Python3.8

From Dev

ImportError: DLL load failed while importing numpy_ops: The specified module could not be found. when importing spacy in Python

From Dev

ImportError: DLL load failed: The specified module could not be found for numpy

From Dev

pyodbc ImportError: DLL load failed: The specified module could > not be found

From Dev

paramiko ImportError: DLL load failed: The operating system cannot run %1

From Python

ImportError: DLL load failed with pybind11 and PCL

Related Related

  1. 1

    "ImportError: DLL load failed while importing" while using PyInstaller

  2. 2

    "ImportError: DLL load failed while importing _openmp_helpers"?

  3. 3

    Jupyter notebook does not launch (ImportError: DLL load failed while importing)

  4. 4

    ImportError: DLL load failed: The file cannot be accessed by the system

  5. 5

    ImportError: DLL load failed: The file cannot be accessed by the system

  6. 6

    How to find which DLL failed in "ImportError: DLL load failed while importing" in python?

  7. 7

    cx_Freeze ImportError: DLL load failed failed while importing _ctypes: The specified module could not be found

  8. 8

    Import error: DLL load failed in Jupyter notebook but working in .py file

  9. 9

    How to resolve "ImportError: DLL load failed:" on Python?

  10. 10

    sklearn. ImportError: DLL load failed

  11. 11

    Pyinstaller ImportError with scipy: DLL load failed

  12. 12

    "ImportError: DLL load failed" when importing tensorflow

  13. 13

    Exception has occurred: ImportError DLL load failed while importing pdftotext: The specified module could not be found

  14. 14

    ImportError: DLL load failed while importing _psycopg: The specified module could not be found

  15. 15

    " ImportError: DLL load failed: The specified procedure could not be found"- while Digit Recognition using CNN in Python using Keras

  16. 16

    ImportError: DLL load failed while importing pyexpat: The specified module could not be found

  17. 17

    How to fix "ImportError: DLL load failed" while importing win32api

  18. 18

    Pyinstaller ImportError : DLL load failed while importing win32gui

  19. 19

    ImportError: DLL load failed: The specified module could not be found. While attempting to import TensorFlow

  20. 20

    How to fix 'ImportError: DLL load failed: The specified procedure could not be found.' while importing tensorflow-gpu?

  21. 21

    (ibm_db) ImportError: DLL load failed while importing ibm_db: The specified module could not be found

  22. 22

    ImportError: DLL load failed while importing QtWebKit: Le module spécifié est introuvable

  23. 23

    Cannot import from pywinauto: ImportError: DLL load failed while importing win32ui: A dynamic link library (DLL) initialization routine failed

  24. 24

    TensorFlow Error: ImportError: DLL load failed with error code 3221225501 while importing _pywrap_ tensorflow_internal in Python3.8

  25. 25

    ImportError: DLL load failed while importing numpy_ops: The specified module could not be found. when importing spacy in Python

  26. 26

    ImportError: DLL load failed: The specified module could not be found for numpy

  27. 27

    pyodbc ImportError: DLL load failed: The specified module could > not be found

  28. 28

    paramiko ImportError: DLL load failed: The operating system cannot run %1

  29. 29

    ImportError: DLL load failed with pybind11 and PCL

HotTag

Archive