我试图在PyDrive中使用欺骗/欺骗。但是,我一直收到一条非常神秘的错误消息,告诉我要参考PyDrive安装手册。这不能提供解决方案。
下面是我正在运行的duply命令的输出,包括错误。
$ duply mac-mini.gdrive status
Start duply v1.11.1, time is 2016-02-20 19:28:59.
Using profile '/etc/duply/mac-mini.gdrive'.
Using installed duplicity version 0.7.06, python 2.7.10, gpg 1.4.19 (Home: ~/.gnupg), awk 'awk version 20070501', grep 'grep (BSD grep) 2.5.1-FreeBSD', bash '4.3.42(1)-release (x86_64-apple-darwin14.5.0)'.
Checking TEMP_DIR '/tmp' is a folder and writable (OK)
Test - En/Decryption skipped. (GPG disabled)
--- Start running command STATUS at 19:29:00.000 ---
BackendException: PyDrive backend requires PyDrive installationPlease read the manpage to fix.
19:29:00.000 Task 'STATUS' failed with exit code '23'.
--- Finished state FAILED 'code 23' at 19:29:00.000 - Runtime 00:00:00.000 ---我正在运行OSX10.11.3,安装了brew和pip。我用过pip来安装吡咯烷酮。
$ pip install pyDrive
Requirement already satisfied (use --upgrade to upgrade): pyDrive in /Library/Python/2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): google-api-python-client>=1.2 in /Library/Python/2.7/site-packages (from pyDrive)
Requirement already satisfied (use --upgrade to upgrade): PyYAML>=3.0 in /Library/Python/2.7/site-packages (from pyDrive)
Requirement already satisfied (use --upgrade to upgrade): six<2,>=1.6.1 in /Library/Python/2.7/site-packages (from google-api-python-client>=1.2->pyDrive)
Requirement already satisfied (use --upgrade to upgrade): oauth2client<3,>=2.0.0 in /Library/Python/2.7/site-packages (from google-api-python-client>=1.2->pyDrive)
Requirement already satisfied (use --upgrade to upgrade): httplib2<1,>=0.8 in /Library/Python/2.7/site-packages (from google-api-python-client>=1.2->pyDrive)
Requirement already satisfied (use --upgrade to upgrade): uritemplate<1,>=0.6 in /Library/Python/2.7/site-packages (from google-api-python-client>=1.2->pyDrive)
Requirement already satisfied (use --upgrade to upgrade): pyasn1>=0.1.7 in /Library/Python/2.7/site-packages (from oauth2client<3,>=2.0.0->google-api-python-client>=1.2->pyDrive)
Requirement already satisfied (use --upgrade to upgrade): pyasn1-modules>=0.0.5 in /Library/Python/2.7/site-packages (from oauth2client<3,>=2.0.0->google-api-python-client>=1.2->pyDrive)
Requirement already satisfied (use --upgrade to upgrade): rsa>=3.1.4 in /Library/Python/2.7/site-packages (from oauth2client<3,>=2.0.0->google-api-python-client>=1.2->pyDrive)
Requirement already satisfied (use --upgrade to upgrade): simplejson>=2.5.0 in /Library/Python/2.7/site-packages (from uritemplate<1,>=0.6->google-api-python-client>=1.2->pyDrive)作为参考,我正在运行当前版本的欺骗和欺骗。
$ duply -V
duply version 1.11.1
(http://duply.net)
Using installed duplicity version 0.7.06, python 2.7.10, gpg 1.4.19 (Home: ~/.gnupg), awk 'awk version 20070501', grep 'grep (BSD grep) 2.5.1-FreeBSD', bash '4.3.42(1)-release (x86_64-apple-darwin14.5.0)'.发布于 2016-02-29 09:42:31
更新2016/04/25:
与python2-oauth2client 2.00的不兼容性已被修正为重复0.7.07.1 (见变化量g)。我刚刚在Linux上测试了它,它运行得非常好。
原文如下:
首先,检查您的python2-oauth2client版本。在编写此版本时,2.00似乎还不适用于欺骗性。我不得不将评级降到1.5.2,才能让它再次发挥作用。
第二,确保不同的python版本(OSX内置版本与自制包与手动安装版本与pip版本)没有冲突。完全使用自制可能是个好主意。
第三,确保您的pydrive配置已经完成。下面简要介绍如何使用“普通”Google用户帐户进行操作:
步骤1:创建pydrive后端配置文件
在某处创建一个pydrive配置文件(例如。/etc/duply/pydrive.conf或~/etc/pydrive.conf),其内容如下:
client_config_backend: settings
client_config:
client_id: <client-id-string>.apps.googleusercontent.com
client_secret: <client-secret-string>
save_credentials: True
save_credentials_backend: file
save_credentials_file: </path/to/save/authdata.json>
get_refresh_token: True/etc/duply/pydrive.json或~/etc/pydrive.json)。第二步:告诉别人在哪里可以找到它。
这是通过设置GOOGLE_DRIVE_SETTINGS外壳变量来完成的:
$ export GOOGLE_DRIVE_SETTINGS=/etc/duply/pydrive.conf您可能希望将其添加到您的~/.bashrc中,以便所有shell会话都能自动设置它。
步骤3:首次验证
如“欺骗手册”所引用的:
在第一次运行期间,系统会提示您访问浏览器中的URL,以授予您对驱动器的访问权限。一旦批准,您将收到一个验证代码,以粘贴回欺骗。然后将凭据缓存在上面的文件引用中,以供以后使用。
..。你就完蛋了。
故障排除
如果这仍然不起作用,请检查文件权限:用户是否对上面指定的配置文件具有足够的权限运行重复操作?
发布于 2016-03-03 12:12:25
对于我来说,python2-oauth2ClientVersion2.00也有同样的问题。通过降级到python2-oauth2client 1.5.2来解决。按照基督教蒙德的指示工作很好。
发布于 2019-10-11 08:13:41
欺骗性0.7.10是Python 2脚本。如你所见:
➜ ~ head $(which duplicity)
#!/usr/bin/env python2
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# duplicity -- Encrypted bandwidth efficient backup
# Version 0.7.10 released August 20, 2016
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.因此,确保运行Python 2而不是Python 3。
https://stackoverflow.com/questions/35528278
复制相似问题