Reputation: 441
Hi I'm trying to use python-magic on windows 8 but when I try to import with the command import magic
it gives me this error WindowsError: [Error 193] %1 is not a valid Win32 application
I have tried both with 64-bit and 32-bit version of Python 2.7.10 but I always get this error.
Thx
Upvotes: 2
Views: 2008
Reputation: 609
The only solution for me was installing Microsoft Visual C++ Build Tools (from here). But it's a quite heavy dependency for magic to work under python 2.7.
Upvotes: 0
Reputation: 191
I solve this issue installing the library "python-magic-bin" using the command pip install python-magic-bin
Upvotes: 1
Reputation: 15778
Found it here: https://github.com/ahupp/python-magic/issues/24k
Resolved this by installing the 64-bit version of Cygwin (http://cygwin.com/install.html) and copying the following list of DLLs from \bin to C:\Windows\System32:
cygwin1.dll
cygz.dll
cygmagic-1.dll
(Don't forget to rename it tomagic1.dll
)
Upvotes: 0