python-magic icon indicating copy to clipboard operation
python-magic copied to clipboard

Win64 DLL location

Open steveshaddick opened this issue 12 years ago • 7 comments

Please note that on Windows 7 64bit the dependent DLLs need to be placed in C:\Windows\SysWOW64 (not C:\Windows\System32).

steveshaddick avatar Jul 06 '13 17:07 steveshaddick

Do you have a 64-bit version of libmagic?

ahupp avatar Sep 27 '13 15:09 ahupp

Lots of people have been looking for that.

ahupp avatar Sep 27 '13 15:09 ahupp

please help, all the DLL's I download was giving me 'invalid error' which one of those files should I download? Because , I think most might be outdated, since they were coded in 2007. Kindly share the exact link of the DLL'S

skizzy avatar Oct 09 '13 21:10 skizzy

There's a project named MSYS2. It provides windows builds of common unix packages (and very recent versions of them).

But it's rather sneaky. One has to browse though Haskell wiki to find out that it exist: https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows/MSYS2

Package list: http://sourceforge.net/projects/msys2/files/REPOS/MSYS2/i686/ http://sourceforge.net/projects/msys2/files/REPOS/MSYS2/x86_64/

msys-magic-1.dll can be found in the build of file package.

Using Dependency Walker to figure out other required dll's is left as an exercise for the reader. ;-)

iljau avatar Jan 25 '14 03:01 iljau

You can get the 64 bit DLL by just using the 64 bit Cygwin install quite easily.

fake-name avatar Nov 26 '14 17:11 fake-name

you can also use this build: pidydx

oba2cat3 avatar Sep 20 '16 09:09 oba2cat3

I'm using Win10 x64 with updates. I had an error using the DLLs linked by @oba2cat3. However I used @iljau's sources and got this working. Dependency Walker gave msys-2.0.dll and msys-z.dll as dependencies of file.exe for package version file-5.29-1.

Win10 x64 steps Download from the x86_64 MSYS build repository:

  • msys-file package.
  • msys2-runtime package. Drop usr/bin/msys-2.0.dll inside the usr/bin folder of msys-file package.
  • zlib package. Drop usr/bin/msys-z.dll inside the usr/bin folder of msys-file package.

To get import magic working correctly make sure that the three DLLs are somewhere on your PATH. I also had to add the string value 'msys-magic-1.dll' to the list stored in windows_dlls of magic.py so that the module init searched for the MSYS version. Alternatively you can just rename msys-magic-1.dll -> magic1.dll if you don't want to change the contents of package files.

EDIT Scratch all that. Just follow these instructions.

mattproetsch avatar May 06 '17 12:05 mattproetsch

Merging into https://github.com/ahupp/python-magic/issues/293

ahupp avatar Aug 25 '23 18:08 ahupp