ImportError: DLL load failed: %1 is not a valid Win32 application. But the DLL's are there

前端 未结 21 1222
礼貌的吻别
礼貌的吻别 2020-11-22 14:12

I have a situation very much like the one at ImportError: DLL load failed: %1 is not a valid Win32 application, but the answer there isn\'t working for me.

My Python

相关标签:
21条回答
  • 2020-11-22 14:38

    I just had this problem, it turns it was just because I was using x64 version of the opencv file. Tried the x86 and it worked.

    0 讨论(0)
  • 2020-11-22 14:38

    I faced the same issue when I uninstalled and reinstalled a different version of 2.7.x of Python on my system using a 32 bit Windows Installer. I got the same error on most of my import statements. I uninstalled the newly installed Python and downloaded a 64 bit Windows installer and reinstalled Python again and it worked. Hope this helps you.

    0 讨论(0)
  • 2020-11-22 14:40

    I experienced the same problem while trying to write a code concerning Speech_to_Text.

    The solution was very simple. Uninstall the previous pywin32 using the pip method

    pip uninstall pywin32
    

    The above will remove the existing one which is by default for 32 bit computers. And install it again using

    pip install pywin32
    

    This will install the one for the 64 bit computer which you are using.

    0 讨论(0)
  • 2020-11-22 14:41

    If your build-system (CMake in my case) copies the file from <name>.dll to <name>.pyd, you will get this error if the original file wasn't actually a dll. In my case, building shared libraries got switched off, so the underlying file was actually a *.lib.

    I discovered this error by loading the pyd file in DependencyWalker and finding that it wasn't valid.

    0 讨论(0)
  • 2020-11-22 14:41

    You can install opencv from official or unofficial sites.

    Refer to this question and this issue if you are using Anaconda.

    0 讨论(0)
  • 2020-11-22 14:43

    I found the solution, maybe you can try to use the cmd window rather than the anaconda prompt window to start you first scrapy test.

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