Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: DLL load faild (windows only) #31

Closed
tomkooij opened this issue May 2, 2018 · 19 comments
Closed

ImportError: DLL load faild (windows only) #31

tomkooij opened this issue May 2, 2018 · 19 comments
Assignees

Comments

@tomkooij
Copy link
Contributor

tomkooij commented May 2, 2018

The current packages (build 8), or at least the 64bit windows 3.4.3-py_36_8 package is broken.

This is probably due to the recently merged #30

This switches from the internal blosc to external blosc (conda package) to prevent zlib import errors.

(py3) C:\Users\Tom>conda create -n test python=3.6 pytables -c conda-forge
Fetching package metadata .............
Solving package specifications: .

Package plan for installation in environment C:\Users\Tom\Miniconda3\envs\test:

The following NEW packages will be INSTALLED:

    blosc:          1.7.0-vc14_2
    bzip2:          1.0.6-vc14_1     conda-forge [vc14]
    certifi:        2018.4.16-py36_0 conda-forge
    hdf5:           1.10.1-vc14_2    conda-forge [vc14]
    mkl:            2017.0.3-0
    numexpr:        2.6.4-py36_1     conda-forge
    numpy:          1.13.1-py36_0
    pip:            9.0.3-py36_0     conda-forge
    pytables:       3.4.3-py36_8     conda-forge
    python:         3.6.5-1          conda-forge
    setuptools:     39.1.0-py36_0    conda-forge
    six:            1.11.0-py36_1    conda-forge
    vc:             14-0             conda-forge
    vs2015_runtime: 14.0.25420-0     conda-forge
    wheel:          0.31.0-py36_0    conda-forge
    wincertstore:   0.2-py36_0       conda-forge
    zlib:           1.2.11-vc14_0    conda-forge [vc14]

Proceed ([y]/n)? y

mkl-2017.0.3-0 100% |###############################| Time: 0:00:12  10.98 MB/s
vs2015_runtime 100% |###############################| Time: 0:00:01   1.59 MB/s
python-3.6.5-1 100% |###############################| Time: 0:00:05   3.84 MB/s
vc-14-0.tar.bz 100% |###############################| Time: 0:00:00  63.04 kB/s
certifi-2018.4 100% |###############################| Time: 0:00:00   9.36 MB/s
numpy-1.13.1-p 100% |###############################| Time: 0:00:00  11.02 MB/s
six-1.11.0-py3 100% |###############################| Time: 0:00:00   1.38 MB/s
wincertstore-0 100% |###############################| Time: 0:00:00 744.27 kB/s
setuptools-39. 100% |###############################| Time: 0:00:00   3.72 MB/s
numexpr-2.6.4- 100% |###############################| Time: 0:00:00 193.14 kB/s
wheel-0.31.0-p 100% |###############################| Time: 0:00:00 753.62 kB/s
pip-9.0.3-py36 100% |###############################| Time: 0:00:01   1.81 MB/s
#
# To activate this environment, use:
# > activate test
#
# To deactivate this environment, use:
# > deactivate test
#
# * for power-users using bash, you must source
#


(py3) C:\Users\Tom>activate test

(test) C:\Users\Tom>python
Python 3.6.5 | packaged by conda-forge | (default, Apr  6 2018, 16:13:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tables
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Tom\Miniconda3\envs\test\lib\site-packages\tables\__init__.py", line 93, in <module>
    from .utilsextension import (
ImportError: DLL load failed: Kan opgegeven module niet vinden.
@tomkooij
Copy link
Contributor Author

tomkooij commented May 2, 2018

Mmmh... The package is built against blosc-1.14.3 from defaults but 1.7.0 from conda-forge was installed:

This is from the appveyor build:

he following NEW packages will be INSTALLED:
    blas:           1.1-openblas                  conda-forge
    blosc:          1.14.3-he51fdeb_0             defaults   
    bzip2:          1.0.6-vc14_1                  conda-forge [vc14         ]

This is from my env:

The following NEW packages will be INSTALLED:

    blosc:          1.7.0-vc14_2

But I cannot install 1.14.3 (conda can't find it...) to see if that fixes things.

@tomkooij
Copy link
Contributor Author

tomkooij commented May 2, 2018

This can be fixed by:

(py36) C:\Users\Tom>conda install blosc=1.14.3 -c anaconda
Fetching package metadata .............
Solving package specifications: .

Package plan for installation in environment C:\Users\Tom\Miniconda3\envs\py36:

The following NEW packages will be INSTALLED:

    snappy: 1.1.7-vc14h2dea872_1 anaconda [vc14]

The following packages will be UPDATED:

    blosc:  1.7.0-vc14_2                  --> 1.14.3-he51fdeb_0 anaconda

@tomkooij tomkooij changed the title ImportError: DLL load faild ImportError: DLL load faild (windows only) May 2, 2018
@tomkooij tomkooij self-assigned this May 2, 2018
@tomkooij
Copy link
Contributor Author

tomkooij commented May 2, 2018

So this is caused by missing win-64 blosc packages in conda-forge and outdated blosc in defaults

I will try to fix

@tritemio
Copy link

Hi @jakirkham, @tomkooij, it seems like pytables is broken on windows since 3.4.3_8 due to failed import of the blosc DLL. I encountered this issue in the latest FRETBursts recipe, but will likely affect many more packages.

I temporary fixed the build by requiring pytables 3.3. Is there a better workaround? Would be possible to pin pytables from anaconda?

@jetuk
Copy link

jetuk commented Aug 6, 2018

After some debugging on my Windows machine it appears this is because of a missing dependency (DLL) for snappy. However, I am a bit confused. It looks like this package still distributes a blosc.dll despite depending on the external blosc package. It is this internal dependency that depends on snappy.dll. The external blosc.dll does not.

For the time being the package can be made to work by installing snappy: conda install snappy. This works for me.

However, I it seems the correct solution is to remove the internally generated blosc.dll if the package is meant to rely on an externally provided binary?

@jetuk
Copy link

jetuk commented Aug 6, 2018

A little more digging and you can find where the recipe is still building internal blosc sources: https://ci.appveyor.com/project/conda-forge/pytables-feedstock/branch/master/job/hq1p3clyqdb8towt#L589

I assume after #30 this is unintended?

@scopatz
Copy link
Member

scopatz commented Aug 6, 2018

Yeah, this is probably unintended.

@tritemio
Copy link

tritemio commented Aug 7, 2018

Thanks @jetuk, the snappy trick worked for me: conda-forge/fretbursts-feedstock#16.

@zxy126
Copy link

zxy126 commented Nov 15, 2018

Now, "conda install pytables -c conda-forge" can fix it perfectly.

@scopatz
Copy link
Member

scopatz commented Nov 15, 2018

Shall we close this then?

@kylekeppler
Copy link

I am still getting this with pytables 3.4.4 build py35_8 from conda-forge.

conda install snappy installed 1.1.7 build h6538335_1002 from conda forge and solves the problem.

Seems to me the receipe needs to add snappy as a dependency.

@EricR86
Copy link
Contributor

EricR86 commented Jan 15, 2019

@kylekeppler this is because the Python 3.5 builds are no longer being built by the Travis CI machine. I'm not sure why. Both Python 3.6 and 3.7 are now being updated however.

I've filed Issue #45

@jason-sachs
Copy link

I have the same issue with pytables 3.5.2 in Python 2.7 -- (blosc version is 1.17.1) -- is there a way to fix? how do I know what blosc version I need?

@jason-sachs
Copy link

OK, pytables 3.5.1 (2.7) seems to work fine with blosc 1.17.1 but pytables 3.5.2 does not. Can someone advise? Should I open a new item for this?

(testenv2) C:\>conda list blosc
# packages in environment at c:\app\python\anaconda\3\envs\testenv2:
#
# Name                    Version                   Build  Channel
blosc                     1.17.1               hc56fc5f_0    conda-forge

(testenv2) C:\>conda list pytables
# packages in environment at c:\app\python\anaconda\3\envs\testenv2:
#
# Name                    Version                   Build  Channel
pytables                  3.5.2            py27h6a9b274_1

(testenv2) C:\>python
Python 2.7.18 |Anaconda, Inc.| (default, Apr 23 2020, 17:26:54) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tables as pt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\app\python\anaconda\3\envs\testenv2\lib\site-packages\tables\__init__.py", line 93, in <module>
    from .utilsextension import (
ImportError: DLL load failed: The specified module could not be found.

@jakirkham
Copy link
Member

It looks like pytables is coming from defaults, not conda-forge. Can you please raise the issue with Anaconda?

@jason-sachs
Copy link

ok thx. Which github repo to raise an issue?

@jason-sachs
Copy link

jason-sachs commented Oct 21, 2020

(side note: is there a chat/mailing list to ask these sort of questions?) nm I found https://gitter.im/conda-forge/conda-forge.github.io

@jakirkham
Copy link
Member

jakirkham commented Oct 21, 2020

ok thx. Which github repo to raise an issue?

Anaconda keeps their recipes in this org ( https://github.com/AnacondaRecipes/ ). Would look for the feedstock in there and file an issue against it.

@alyosama
Copy link

alyosama commented Nov 9, 2021

I had the same problem and I solved it by searching for the location of pytables_hdf5.dll
Then I added its folder to the path by the following

import os
os.environ['PATH'] += os.pathsep + os.path.expanduser(r'C:\Users\alyos\AppData\Roaming\Python\Python37\site-packages\tables-3.6.1-py3.7-win-amd64.egg\Lib\site-packages\tables')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants