0

I'm trying to use s3cmd on a Synology NAS with DSM 6.0, and I'm getting this error. I've installed the python-magic libs but still.

[root@OFFICE_01 arc]# s3cmd --version

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    An unexpected error has occurred.
  Please try reproducing the error using
  the latest s3cmd code from the git master
  branch found at:
    https://github.com/s3tools/s3cmd
  and have a look at the known issues list:
    https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions
  If the error persists, please report the
  following lines (removing any private
  info as necessary) to:
   s3tools-bugs@lists.sourceforge.net

Error loading some components of s3cmd (Import Error)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Invoked as: /bin/s3cmd --version
Problem: RuntimeError: can not find library magic
S3cmd:   2.0.1+
python:   2.7.12 (default, Apr 20 2017, 02:26:22) 
[GCC 4.9.3 20150311 (prerelease)]
environment LANG=en_US.UTF-8

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/s3cmd-2.0.1-py2.7.egg/EGG-INFO/scripts/s3cmd", line 3054, in <module>
  File "/usr/bin/S3/S3.py", line 50, in <module>
    import magic
  File "/usr/lib/python2.7/site-packages/magic.py", line 155, in <module>
    dll = ctypes.util.find_library('magic') or ctypes.util.find_library('magic1') or ctypes.util.find_library('cygmagic-1')
  File "/usr/lib/python2.7/ctypes/util.py", line 242, in find_library
    raise RuntimeError("can not find library %s" % name)
RuntimeError: can not find library magic

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    An unexpected error has occurred.
  Please try reproducing the error using
  the latest s3cmd code from the git master
  branch found at:
    https://github.com/s3tools/s3cmd
  and have a look at the known issues list:
    https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions
  If the error persists, please report the
  above lines (removing any private
  info as necessary) to:
   s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!``
brunobhr
  • 43
  • 9
  • Obviously you and the system disagree: " I've installed the python-magic" vs "RuntimeError: can not find library magic". You will probably need to give more details on how you installed the library... – Patrick Mevzek Apr 17 '19 at 22:32
  • I agree we disagree! [root@OFFICE_01 ~]# pip install python-magic Requirement already satisfied: python-magic in /usr/lib/python2.7/site-packages (0.4.15) – brunobhr Apr 17 '19 at 22:36
  • The python part of the library is here but it tries to load its C (DLL) part and does not find it. Do you have `libmagic` installed? – Patrick Mevzek Apr 17 '19 at 22:40
  • Yes..[root@OFFICE_01 ~]# pip install libmagic Requirement already satisfied: libmagic in /usr/lib/python2.7/site-packages (1.0) – brunobhr Apr 17 '19 at 22:47
  • If you wouldn't mind voting this question as at least genuine and informed, that'd already be of great help, as I am struggling with my profile despite doing my very best to follow the etiquette.. – brunobhr Apr 17 '19 at 23:22

1 Answers1

0

I managed to make use of s3cmd by upgrading to Python 3 and pip3:

>opkg install python3-pip

>pip3 install s3cmd

[root@OFFICE_01 ~]# s3cmd --version
s3cmd version 2.0.2
brunobhr
  • 43
  • 9