Why PyQt5 import failed in Python3.4 with `ImportError: DLL load failed` in Windows 7?

前端 未结 1 1759
醉话见心
醉话见心 2020-12-22 04:12

I have 32-bit Python2.7 already installed in Windows 7 (64-bit Operating System) and I can use it without any errors. Besides, I attempted to install

相关标签:
1条回答
  • 2020-12-22 04:37

    Too complex situation. You have 64-bit Windows, which can install both 64 and 32-bit software. So you can install both 2.x and 3.x in both variants. For each Python installation, there could be 4 type of PyQt available, 4 & 5, both in 32 and 64-bit version. So the possibility of error is 2 * 4 * 4 * 2 = 64 times complex. Jokes apart.

    Let's look at the error:

    ImportError: DLL load failed: %1 is not a valid Win32 application.
    

    Let's break it down:

    • ImportError: Nature of error we are getting is Import related. Python is not able to load specified module(s). Let's move forward.
    • DLL load failed: This message more or less says that module was in form of .dll file.
    • %1 is not a valid Win32 application. This error has most of the info. %1, which is more like an argument representing PyQt5, is not a valid Win32 application.

    By looking at the error, it can be seen that interpreter looking for a Win32 application, which simply means a 32-bit application. But why would interpreter want a 32-bit module? Guess? Because interpreter itself is 32-bit!

    It can't yet be said that it is Python3 or Python2 interpreter because error only specifies 32 or 64-bit information. But in your case it's your Python 2 interpreter because it's only the 32-bit interpreter on your system.

    0 讨论(0)
提交回复
热议问题