ahupp / python-magic

A python wrapper for libmagic
Other
2.65k stars 283 forks source link

Binary distribution for libmagic on Windows #293

Open ahupp opened 1 year ago

ahupp commented 1 year ago

Windows users regularly run into issues with incompatible/broken or not found magic installations. Current issues:

https://github.com/ahupp/python-magic/issues/137 https://github.com/ahupp/python-magic/issues/288 https://github.com/ahupp/python-magic/issues/225 https://github.com/ahupp/python-magic/issues/276 https://github.com/ahupp/python-magic/issues/248 https://github.com/ahupp/python-magic/issues/87 https://github.com/ahupp/python-magic/issues/139 https://github.com/ahupp/python-magic/issues/233 https://github.com/ahupp/python-magic/issues/73 https://github.com/ahupp/python-magic/issues/60 https://github.com/ahupp/python-magic/issues/34

This task is to document/implement a more reliable solution for windows.

jspraul commented 1 year ago

python-magic-bin v0.4.14 was published in 2017. vcpkg can build libmagic v5.40 (circa 2021) with some tweaks for Windows.

Related: https://github.com/hey-red/Mime/issues/49 | https://github.com/hey-red/Libmagic-Build/tree/master/windows

Windows build is most problematic part of this

ahupp commented 1 year ago

Thanks for the details. This PR adds build setup for shipping binaries, I'll look it over in detail soon: https://github.com/ahupp/python-magic/pull/294

On Mon, Sep 4, 2023, 10:08 PM jspraul @.***> wrote:

python-magic-bin https://pypi.org/project/python-magic-bin/#files v0.4.14 was published in 2017. vcpkg https://github.com/microsoft/vcpkg#quick-start-windows can build libmagic v5.40 with some tweaks https://github.com/microsoft/vcpkg/tree/master/ports/libmagic for Windows.

-

Download and install the Visual Studio 2017 Build Tools https://aka.ms/vs/15/release/vs_buildtools.exe (link source https://stackoverflow.com/questions/57795314/are-visual-studio-2017-build-tools-still-available-for-download/64224475#64224475 )

— Reply to this email directly, view it on GitHub https://github.com/ahupp/python-magic/issues/293#issuecomment-1705951174, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAJ5ESG6CCUHYWVIQVJPQ3XY2XVXANCNFSM6AAAAAA363A7PU . You are receiving this because you authored the thread.Message ID: @.***>

martin-braun commented 3 weeks ago

On Windows #248 is still a problem and automatic monkey patching is not an option when using pipx, because the cache path (virtual environment path) is always random.