python-3.xpytableshdfstore

DLL load failed for pytables


I get the following error when running code containing pytables:

Traceback (most recent call last):
File "C:\Users\pierr\python354\lib\site-packages\pandas\io\pytables.py", line 469, in __init__
import tables  # noqa
File "C:\Users\pierr\python354\lib\site-packages\tables\__init__.py", line 90, in <module>
from .utilsextension import (
ImportError: DLL load failed: The specified procedure could not be found.

...
 File "C:\Users\pierr\python354\lib\site-packages\pandas\io\pytables.py", line 472, in __init__
'importing'.format(ex=str(ex)))
ImportError: HDFStore requires PyTables, "DLL load failed: The specified procedure could not be found." problem importing

python version 3.5.4 | tables version 3.4.2 | windows 10


Solution

  • I had a similar problem. When I tried to run the following code:

    import pandas as pd
    df = pd.read_hdf('some.hdf')
    

    I got an error:

    ImportError: Missing optional dependency 'tables'.  Use pip or conda to install tables.
    

    Even though the pytables module was installed using both conda and pip (with last, of course as tables), the error still persisted. The import tables didn't work either:

    from .utilsextension import (
    ImportError: DLL load failed: Не найден указанный модуль.
    

    "Не найден указанный модуль" means "The specified module was not found" in Russian.
    I climbed into the folder where the last module from the Traceback is located - '~\AppData\Roaming\Python\Lib\site-packages\tables' and found file named utilsextension.cp37-win_amd64.pyd there. Then I downloaded Dependency Walker utility and looked at this file. The program said it couldn't find pytables_hdf5.dll. I found this file in the folder ~\AppData\Roaming\Python\Lib\site-packages\tables\ and added it to a PATH variable by:

    os.environ['PATH'] += os.pathsep + os.path.expanduser('~\\AppData\\Roaming\\Python\\Lib\\site-packages\\tables')
    

    After that everything worked, import tables and pd.read_hdf return no more errors. Hope this is useful to someone.