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 failed: The specified module could not be found. #45

Closed
amueller opened this issue Apr 24, 2018 · 24 comments
Closed

Comments

@amueller
Copy link

Some of my users have reported an error trying to import PIL:
amueller/word_cloud#356

They are using this version:

    pillow:          5.1.0-py36_0      conda-forge

This seems related: python-pillow/Pillow#2945

@almarklein
Copy link

For reference, this seems to be the (somewhat sad) workaround:

$ conda remove pillow
$ pip install pillow

@ocefpaf
Copy link
Member

ocefpaf commented Apr 24, 2018

Please ask your users to post the issue here with more details.

@amueller
Copy link
Author

@ocefpaf there's some more detail in the two issues I linked to. What do you need to know?

@steremma
Copy link

steremma commented Apr 24, 2018

While the workaround works, it is suboptimal in cases where pillow is a requirement of another project being conda install'ed. In that case, even if I temporarily fix the issue using the proposed solution, the next installation will override the pip install'ed version of pillow.

Could we somehow force an installation of the depended package (wordcloud in this case) to NOT install its dependencies but use the existing one's instead?

Sorry for not providing details but i am not on Windows atm, if its needed I can provide them tomorrow.

@ocefpaf
Copy link
Member

ocefpaf commented Apr 24, 2018

@ocefpaf there's some more detail in the two issues I linked to.

OK. So it seems that the issue happens on Windows.
That s the hardest for us to debug b/c most of us do not use Windows.

What do you need to know?

Can you try a fresh env? It usually helps to debug things,

conda create --name TEST --channel conda-forge pillow wordcloud
conda activate TEST
python -c 'import  wordcloud; print(wordcloud.__version__)'

If that fails please paste the results of conda info --all and conda list for that env.

@amueller
Copy link
Author

You can also just import PIL to get the error, I think.

@hugovk
Copy link
Contributor

hugovk commented Apr 24, 2018

Pillow has a public Python interface, and a private C core.

When the Python layer tries to use the C layer, it does a version check to ensure they're both the same version.

The error in amueller/word_cloud#356 is when they have different versions.

What must be happening is there's one version of pip installed Pillow and another version of conda installed Pillow.

Then whichever Python part of Pillow is being run is trying to access the C part from the other version.

@ocefpaf
Copy link
Member

ocefpaf commented Apr 24, 2018

Pillow has a public Python interface, and a private C core.

That is why we need the fresh env test in #45 (comment)

@ocefpaf
Copy link
Member

ocefpaf commented Jul 2, 2018

Closing this as stale. If someone is still experiencing this please open a new issue with more details so we can investigate.

@ocefpaf ocefpaf closed this as completed Jul 2, 2018
@amueller
Copy link
Author

amueller commented Jul 2, 2018

I keep getting issues on that, I'll try to direct them here.

@ocefpaf
Copy link
Member

ocefpaf commented Jul 2, 2018

I keep getting issues on that, I'll try to direct them here.

Please do. Unfortunately we could not reproduce that error and without communication with the people reporting it things get hard to reproduce. Thanks!

@carlodri
Copy link

@ocefpaf I just stumbled into this (at least, it looks like the same issue to me) in an AppVeyor CI for a feedstock: https://ci.appveyor.com/project/conda-forge/pycroscopy-feedstock/build/1.0.17/job/7e4a3cl9i0f9wvxv
CI triggered from conda-forge/pycroscopy-feedstock#4

@ocefpaf
Copy link
Member

ocefpaf commented Aug 10, 2018

Recently this may be related to conda/conda#7626

@carlodri
Copy link

@ocefpaf thanks, although I'm honestly not deep enough into conda to fully understand what's going on there. Do you have any practical suggestion to get out of the rabbit hole in our specific case of conda-forge/pycroscopy-feedstock#4?

@carlodri
Copy link

@ocefpaf in fact, in the failing CI, pillow is taken from the defaults channel (https://ci.appveyor.com/project/conda-forge/pycroscopy-feedstock/build/1.0.18/job/d751rvrngowts87c#L952), whereas just one commit before, it was taken from conda-forge (https://ci.appveyor.com/project/conda-forge/pycroscopy-feedstock/build/1.0.16/job/tpkbh7pcq9u3m5uf#L952)

do you have any suggestions?

@ocefpaf
Copy link
Member

ocefpaf commented Aug 11, 2018

do you have any suggestions?

Make noise here conda/conda#7626

There is nothing we can do, it is a bun in conda.

@carlodri
Copy link

but does pillow use features?

@ocefpaf
Copy link
Member

ocefpaf commented Aug 11, 2018

Most pillow dependencies do.

@absognety
Copy link

absognety commented Sep 27, 2018

I solved by using subprocess, remove all improper installations of pillow and wordcloud left overs using conda remove pillow,conda remove wordcloud and manually remove the cache and folders manually from former installations and use subprocess.check_call(["python", '-m', 'pip', 'install', 'pillow'] and subprocess.check_call(["python", '-m', 'pip', 'install', 'wordcloud'] for later versions of pip ( from 10.0.0) which has no main function as a method within the class, if you want to use pip from within Ipython or python console/interpreter.

@carlodri
Copy link

carlodri commented Oct 6, 2018

This issue is still blocking this PR conda-forge/pycroscopy-feedstock#4

@carlodri
Copy link

carlodri commented Oct 7, 2018

Most pillow dependencies do.

really? I can't see a single one using the features or track_features keywords... probably I'm missing something...

@carlodri
Copy link

solved with a hack from conda-forge/hyperspy-feedstock#24, simply adding this version constraint in the recipe: pillow >5.2

⚠️ I haven't the slightest idea of why this works.... ⚠️

@hadim
Copy link
Member

hadim commented Nov 29, 2018

Can you reopen here, please? The issue still happens: widgetti/ipyvolume#208 (comment)

@hadim
Copy link
Member

hadim commented Nov 29, 2018

Or maybe pillow >5.2 is the only way to easily get around this.

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

8 participants