2

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

matebende
  • 543
  • 1
  • 7
  • 21
Lorenzo Bottaccioli
  • 441
  • 1
  • 7
  • 20
  • Same problem! Did you solve it? – Olivier Pons Dec 07 '15 at 23:09
  • I have the same problem. I've tried this: https://github.com/pidydx/libmagicwin64 and have spent days searching for a solution, but with no result so far. I've also tried what the answers recommended, but neither of them helped. Any suggestions? – matebende Sep 22 '20 at 08:56

3 Answers3

1

I solve this issue installing the library "python-magic-bin" using the command pip install python-magic-bin

Dima Kozhevin
  • 3,602
  • 9
  • 39
  • 52
João Godinho
  • 191
  • 1
  • 4
0

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 to magic1.dll)
Olivier Pons
  • 15,363
  • 26
  • 117
  • 213
0

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.

matebende
  • 543
  • 1
  • 7
  • 21