Created
March 4, 2019 12:53
-
-
Save abakum/c08e611e41c872256bb39a169abd7e92 to your computer and use it in GitHub Desktop.
Fix error "raise ImportError('failed to find libmagic. Check your installation')" after "pip install python-magic" then "import magic" in python of MINGW
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mklink "C:\msys64\usr\bin\magic1.dll" "C:\msys64\usr\bin\msys-magic-1.dll" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
choco install msys2
msys2.exe
pacman -S git --needed
pacman -S base-devel --needed
exit
mingw64.exe
pacman -S $MINGW_PACKAGE_PREFIX-toolchain --needed
git clone https://github.com/threatstack/libmagic.git
cd libmagic
./configure
make
make install
file -v
Look:
C:\msys64\mingw64\bin\file.exe-5.18
magic file from C:\msys64\mingw64\bin/../share/misc/magic.mgc
ln -s /mingw64/bin/libmagic-1.dll /mingw64/bin/magic1.dll