-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binary distribution for libmagic on Windows #293
Comments
python-magic-bin v0.4.14 was published in 2017. vcpkg can build libmagic v5.40 (circa 2021) with some tweaks for Windows.
Related: hey-red/Mime#49 | https://github.com/hey-red/Libmagic-Build/tree/master/windows
|
Thanks for the details. This PR adds build setup for shipping binaries,
I'll look it over in detail soon:
#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>
)
- On the left, select Windows > Visual C++ build tools
- Then on the right, confirm Visual C++ tools for CMake is selected
- (3.3GB+ download since Windows 10 SDK is a dependency 😢)
[image: image]
<https://user-images.githubusercontent.com/115931/265579872-a0fe3619-6c3a-434b-808c-2bcbd08da733.png>
-
Per https://github.com/microsoft/vcpkg#quick-start-windows:
- git clone https://github.com/microsoft/vcpkg
- .\vcpkg\bootstrap-vcpkg.bat
- .\vcpkg\vcpkg install libmagic --triplet=x64-windows
-
Under .\vcpkg\packages\libmagic_x64-windows (don't use mine
<https://github.com/ahupp/python-magic/files/12518768/libmagic_x64-windows.zip>)
you'll find:
- *tools\libmagic\bin\magic-1.dll*
- python-magic loads libmagic.dll, you'll need to rename to this
- *tools\libmagic\bin\tre.dll*
- *tools\libmagic\share\misc\magic.mgc*
-
Place these files in the current directory, on the path, or overwrite
after pip puts python-magic-bin under \Lib\site-packages\magic\libmagic
- (in the same directory as the script will only work if that is the
current directory or on the path)
—
Reply to this email directly, view it on GitHub
<#293 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAJ5ESG6CCUHYWVIQVJPQ3XY2XVXANCNFSM6AAAAAA363A7PU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
On Windows #248 is still a problem and automatic monkey patching is not an option when using |
Windows users regularly run into issues with incompatible/broken or not found magic installations. Current issues:
#137
#288
#225
#276
#248
#87
#139
#233
#73
#60
#34
This task is to document/implement a more reliable solution for windows.
The text was updated successfully, but these errors were encountered: