我尝试在装有 DSM 6.0 的 Synology NAS 上使用 s3cmd,但出现此错误。我已安装 python-magic 库,但仍然无法使用。
[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:
[email protected]
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:
[email protected]
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!``
答案1
我设法通过升级到 Python 3 和 pip3 来使用 s3cmd:
>opkg install python3-pip
>pip3 install s3cmd
[root@OFFICE_01 ~]# s3cmd --version
s3cmd version 2.0.2