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
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.
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.
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.
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.
You can install opencv
from official or unofficial sites.
Refer to this question and this issue if you are using Anaconda
.
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.