Skip to content

libmagic installation on Windows #264

@PmasonFF

Description

@PmasonFF

This issue has been raised (and ignored) before (open issue #215) but the latest release version 1.4, does not even allow the previous workaround ( installing python-magic-bin or in some cases python-magic-win64).
Currently a standard pip install on a windows machine results in the generation of a libmagic warning :

Broken libmagic installation detected. The python-magic module is installed but can't be imported. Please check that both python-magic and the libmagic shared library are installed correctly. Uploading media other than images may not work.

Upload of any video or audio files fails.

Currently I am running version 1.3 with the package python-magic replaced with python-magic-bin which is fully functional up to the 1.3 version limitations. If I try this workaround in version 1.4 I get:

Traceback (most recent call last):
  File "C:/py/Panoptes_client/work_with_Client_link_subjects.py", line 3, in <module>
    import panoptes_client
  File "C:\Users\User\AppData\Roaming\Python\Python38\site-packages\panoptes_client\__init__.py", line 1, in <module>
    from panoptes_client.classification import Classification
  File "C:\Users\User\AppData\Roaming\Python\Python38\site-packages\panoptes_client\classification.py", line 3, in <module>
    from panoptes_client.panoptes import LinkResolver, PanoptesObject
  File "C:\Users\User\AppData\Roaming\Python\Python38\site-packages\panoptes_client\panoptes.py", line 25, in <module>
    class Panoptes(object):
  File "C:\Users\User\AppData\Roaming\Python\Python38\site-packages\panoptes_client\panoptes.py", line 58, in Panoptes
    'User-Agent': 'panoptes-python-client/version=' + pkg_resources.require('panoptes_client')[0].version
  File "C:\Users\User\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pkg_resources\__init__.py", line 886, in require
    needed = self.resolve(parse_requirements(requirements))
  File "C:\Users\User\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pkg_resources\__init__.py", line 772, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'python-magic<0.5,>=0.4' distribution was not found and is required by panoptes-client

Process finished with exit code 1

From my experience most of the smaller teams on zooniverse are using Windows. Even those on Mac using a 64 bit Python may need to run python-magic-bin, but I am not certain of this. The last team I set up on Mac was Woodpecker Cavity Cams; they were uploading video and the installation was complicated by requiring ffpmeg for file conversion, and I can not recall what we had to do to get panoptes_client working.

Thanks!
Peter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions