zooniverse / panoptes-python-client

Apache License 2.0
30 stars 26 forks source link

Windows 64 bit install needs python-magic-win64 #215

Open PmasonFF opened 5 years ago

PmasonFF commented 5 years ago

Standard install has an explicit requirement 'python-magic>=0.4,<0.5' 64 bit Windows installations requires 'python-magic-win64 in place of this package. This supplies Windows 64 specific dll's which are needed for full functionality of python-magic and a correct libmagic install. Reference https://github.com/axnsan12/python-magic-win64

As a limited workaround, install panoptes-client as described then uninstall python_magic and install python-magic-win64 from pip install python-magic-win64 Then uninstall python-magic again - this will leave panpotes-client in a functioning condition for all image subject manipulations though I am not sure all libmagic functionality for video and audio files is available. Normally one would leave python-magic installed with python-magic-win64 but this causes issues with panoptes-client which continues to try and use the "normal" python-magic.

A patch would be to require python-magic-win64 and import magic using from winmagic import magic This is supposed to work for all platforms but I have not tested it.

Note python-magic-win64 does not yet support the latest version of python-magic 0.4.15

PmasonFF commented 5 years ago

It looks like libmagic also has Windows 64 bit dll's, and the workaround mentioned above does NOT provide video and audio uploading support (though it does get rid of the warning and works fine for images.)

An alternate I am using now is a 32 bit installation of Python 3.7, install panpotes-client as per the readme, then install python-magic-bin, install libmagic, and uninstall python-magic. That combination seems to work for all image and video files on a Windows 64 bit platform.

Again the requirements,txt lists python-magic as the requirement and subject.py tests for the installation of python-magic if the test for a working libmagic fails - these issues will continue to cause issues for Windows installations of panoptes-client ( and I expect panoptescli).