Skip to content

Failure when importing python-magic in windows 10 python 3.9  #248

Closed
@GiuseppeLeviBo

Description

@GiuseppeLeviBo

Hi I have installed the library via pip and received no warning then when I try to import it libmagic is not found:
PS G:\Pythontest> pip install python-magic
Collecting python-magic
Downloading python_magic-0.4.24-py2.py3-none-any.whl (12 kB)
Installing collected packages: python-magic
Successfully installed python-magic-0.4.24
PS G:\Pythontest> python
Python 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import magic
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\xxxxxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\magic_init_.py", line 208, in
libmagic = loader.load_lib()
File "C:\Users\xxxxxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\magic\loader.py", line 49, in load_lib
raise ImportError('failed to find libmagic. Check your installation')
ImportError: failed to find libmagic. Check your installation

How to install the missing library and why pip has not installed it? (or at least failed to install ?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions