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

WIndows 7 DLL load failed #1472

Open
PhilippSelenium opened this issue Jan 15, 2021 · 35 comments · Fixed by #1473
Open

WIndows 7 DLL load failed #1472

PhilippSelenium opened this issue Jan 15, 2021 · 35 comments · Fixed by #1473

Comments

@PhilippSelenium
Copy link

PhilippSelenium commented Jan 15, 2021

>> import zmq
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\venv\lib\site-packages\zmq\__init__.p
    _load_libzmq()
  File "C:\Users\venv\lib\site-packages\zmq\__init__.p
    from . import libzmq
ImportError: DLL load failed: The specified module could not be found.
  • python 3.6.8 (Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32)
  • windows 7 enterprise
  • pyzmq==21.0.0

Note: Works fine with pyzmq==20.0.0
Maybe some packaging error?

@minrk
Copy link
Member

minrk commented Jan 15, 2021

Thanks for testing! Indeed, this is the first release built from a new CI infrastructure. win32 or win_amd64?

@PhilippSelenium
Copy link
Author

It is 64bit

@minrk
Copy link
Member

minrk commented Jan 15, 2021

Hm, ok. I've tested 32b and 64b on my Windows VM (server-2019) and they work okay. I'll see if I can find an older one. Maybe they've been linked with some too-recent dependency.

Can you test with a later Python to see if it's isolated to 3.6?

@PhilippSelenium
Copy link
Author

I get the same error for:

Python 3.8.7 (tags/v3.8.7:6503f05, Dec 21 2020, 17:59:51) [MSC v.1928 64 bit (AMD64)] on win32

@m-melis
Copy link

m-melis commented Jan 15, 2021

Probably related to error "Windows fatal exception: code 0xc0000139" we are getting with version 21. Was fine with version 20.

https://gitlab.com/secml/secml/-/jobs/965036924

@minrk
Copy link
Member

minrk commented Jan 15, 2021

I set up a new VM with server-2012 and get the same errors due to missing DLLs (first: vcruntime140_1.dll, which is added in Python >=3.8).

I think I tracked it down to building on windows-2019 with vs2019 instead of windows-2016 with vs2017. GitHub Actions doesn't appear to have a build environment with vs2015, which is used for Python 3.6, so we'll see.

#1473 will build new wheels with vs2017 and we can test them out.

@minrk
Copy link
Member

minrk commented Jan 15, 2021

@PhilippSelenium can you test with the wheels in the wheels-win_amd64 artifact? It's a zipfile of win_amd64 wheels for py36-39. They work on my Windows server-2012 VM, so I think they are going to work for you. I'll go a head and cut 21.0.1 with the fix if you can confirm that those wheels work for you.

@minrk
Copy link
Member

minrk commented Jan 15, 2021

depending on timeline, I will cut 21.0.1 before I have to quit for the day if I don't hear anything (I'm not sure what your timezone is, it might already be the middle of the night for you!), since it at least fixes the issue for my environment where I was able to reproduce the issue. There's always 21.0.2 :)

@PhilippSelenium
Copy link
Author

@minrk Thanks for the lightning fast fix. Sadly it does not fix my problem. But it might have to do with my environment. I'm investigating ...

@minrk
Copy link
Member

minrk commented Jan 15, 2021

make sure to remove the old pyzmq before installing the new one, since those wheels have the same version and a simple pip install ./pyzmq-21... will give "I already have that!" and not actually install the new one.

I used Dependency Walker on the installed libzmq....pyd to identify what's missing. If you can do the same and share a screenshot, that would help.

@PhilippSelenium
Copy link
Author

I uninstalled the old zmq first and also checked that the folder is not in site-packages.

As requested I attached a screenshot
dependencywalker

@minrk
Copy link
Member

minrk commented Jan 15, 2021

Does the python 3.8 wheel work for you?

@PhilippSelenium
Copy link
Author

No it is the same error for both :(

@PhilippSelenium
Copy link
Author

PhilippSelenium commented Jan 15, 2021

Using pyzmq==20.0.0 (which works for me) I get the following dependency erros:
pzymq_20_0_0

I also tried reinstalling vc_redist.x64.exe but the problem might be the old windows version or just using windows.
I will try to update to win10 or pin the pyzmq dependency.

@minrk
Copy link
Member

minrk commented Jan 15, 2021

ok, looks like it's building with a target minimum Windows of 8.1. Now I just have to figure out how to tell it not to do that. I can't find any docs about it for Python so far.

@minrk minrk reopened this Jan 15, 2021
@minrk
Copy link
Member

minrk commented Jan 15, 2021

I need to stop for today, but I'm going to merge #1473 and release 21.0.1 now as it at least moves the base required Windows back (to 8.1, I think). I'll look at fixing it for Windows 7 as soon as I can (or if someone else knows how, that would be awesome!).

@SoerenXD
Copy link

We were having the same issue on Windows 10, 64bit with Python 3.7
Downgrading to 20.0 solved it for now.

@minrk
Copy link
Member

minrk commented Jan 18, 2021

@SoerenXD did you have 21.0.0 or 21.0.1? I would expect 21.0.0 to fail but 21.0.1 to fix your case.

@minrk
Copy link
Member

minrk commented Jan 18, 2021

@m-melis I believe your case should be fixed by 21.0.1 as well, if you could confirm. I can't tell from the link what version of Windows it is, but assuming it's a version that's not EOL by Microsoft, I think it should work (oldest Windows versions in extended support appear to be Windows 8.1, Windows Server 2012 R2)

@m-melis
Copy link

m-melis commented Jan 18, 2021

@m-melis I believe your case should be fixed by 21.0.1 as well, if you could confirm. I can't tell from the link what version of Windows it is, but assuming it's a version that's not EOL by Microsoft, I think it should work (oldest Windows versions in extended support appear to be Windows 8.1, Windows Server 2012 R2)

Still crashing with 21.0.1. I've checked and our test environment should be Win-1809, actually. Python 3.6.

I'm going to test installing vcredist140 instead of vcredist2017 to see if anything changes.

@minrk
Copy link
Member

minrk commented Jan 18, 2021

Hm, that's getting more mysterious. My test VM is Server 2012 R2 with Python 3.6.8 (from official Python.org installer) and no vcredist packages installed and it's working (both 32 and 64b). I also have an 1809 VM, also with no vcredist packages, also working.

How have you installed Python? What *.DLL files are bundled with Python itself?

@minrk
Copy link
Member

minrk commented Jan 20, 2021

@PhilippSelenium I got some help and I believe #1475 will fix support for Windows 7. Can you test the wheels from #1475 and #1476 and report back?

@PhilippSelenium
Copy link
Author

PhilippSelenium commented Jan 20, 2021

@minrk I tested the wheels from both PRs both of them still throw the missing DLL error :(
Also I'm puzzled: I downloaded the artifacts from the build but now the build has failed and I can no longer download them ... did I use the correct ones (pyzmq-21.0.2.dev0)

@minrk
Copy link
Member

minrk commented Jan 20, 2021

I realized I missed something. Can you try the ones form this build?

@minrk
Copy link
Member

minrk commented Jan 20, 2021

Nope, sorry, messed it up again. The builds to test will be this one for vs2017 and this one for vs2019. I hope the vs2017 should work this time, but I'm less confident about vs2019.

@minrk
Copy link
Member

minrk commented Jan 20, 2021

My understanding from this discussion is that vs2019 should work, but I may need to also update my bundle-vcruntime code.

@minrk
Copy link
Member

minrk commented Jan 20, 2021

Nope again, maybe these builds will work:

There doesn't appear to be any way to test the supported Windows versions of the compiled artifacts other than "have an old Windows and try to import it" and I have no way to get any Windows older than Server 2012, so I cannot test the Windows 7 support.

@PhilippSelenium
Copy link
Author

Nope sorry still the same error.

@minrk
Copy link
Member

minrk commented Jan 21, 2021

ok, then I don't understand what to do and am out of ideas. Maybe i'm setting WINVER wrong, or maybe there's something else I need to turn off to prevent whatever mysterious thing that I didn't touch is requiring more recent Windows. Since all versions of Windows with any level of support from Microsoft appear to work fine (>=8.1), I'm not sure I can put any more time into this at the moment.

@minrk
Copy link
Member

minrk commented Jan 21, 2021

Actually, one more to try: can you test this (Python 3.8) wheel: https://file.io/4t3qnohuDcOh

If that works, I have one last option before giving up.

Thank you so much for your dbugging help!

@PhilippSelenium
Copy link
Author

@minrk No, that is not working either.
No problem, I will as mentioned pin the version or upgrade windows.
Thanks for trying I appreciate it a lot!

@m-melis
Copy link

m-melis commented Jan 28, 2021

@minrk Dropping by as the v22 fixed the problem in our case! Thanks!

@the-working-rene
Copy link

I had the same issue while running 22.3.0 on Windows 10 with python3.9. But the error only occured, when started as a service (using https://github.com/mhammond/pywin32/ ).

I also tried the other recent versions, the newest version without that error was 22.0.3 for me.

@twangboy
Copy link

twangboy commented Nov 3, 2022

I'm experiencing this issue with all releases of pyzmq after 22.0.3. I'm on a Windows Server 2016 machine. The current latest release is 24.0.1.

@minrk
Copy link
Member

minrk commented Feb 27, 2024

If anyone's still watching this and can test the latest pyzmq wheels pip install --pre pyzmq and report back, that would be lovely. In particular, the Windows builds are totally different and hopefully more reliable, but I'm not confident in my ability to test the problem here.

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