- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试对 PyDrive 使用双重/口是心非。但是,我不断收到一条非常神秘的错误消息,告诉我引用 PyDrive 安装联机帮助页。没有提供解决方案。
这是我正在运行的重复命令的输出,包括错误。
$ 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 ---
我运行的是 OS X 10.11.3,安装了 brew 和 pip。我使用 pip 安装 pydrive。
$ 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)
作为引用,我正在运行 duplicity 和 duply 的当前版本。
$ 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/04/25 更新:
从口是心非的 0.7.07.1 开始,与 python2-oauth2client 2.00 的不兼容性已得到修复(参见 changelog)。我刚刚在 Linux 机器上对其进行了测试,它运行良好。
原文如下:
首先,检查您的 python2-oauth2client 版本。在编写此版本时,2.00 似乎还不能与口是心非一起工作。我不得不降级回 1.5.2 以使其再次运行。
其次,确保没有由不同 python 版本引起的冲突(OSX 内置与自制程序包与手动安装与 pip 等)。专门使用自制软件可能是个好主意。
第三,确保你的pydrive配置完成。以下是如何使用“普通”Google 用户帐户执行此操作的简要说明:
在某处创建一个 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
client_id 和client_secret 可以从 Google Developers Console 的 API 管理器中获取在Google Drive API之后已启用。
将 save_credentials_file 设置为 pydrive 在成功连接后可以缓存身份验证数据的任意位置(例如 /etc/duply/pydrive.json
或~/etc/pydrive.json
).
这是通过设置 GOOGLE_DRIVE_SETTINGS shell 变量来完成的:
$ export GOOGLE_DRIVE_SETTINGS=/etc/duply/pydrive.conf
您可能想将它添加到您的 ~/.bashrc
以便所有 shell session 都自动设置它。
引自口是心非的联机帮助页:
During the first run, you will be prompted to visit an URL in your browser to grant access to your drive. Once granted, you will receive a verification code to paste back into Duplicity. The credentials are then cached in the file references above for future use.
... 大功告成。
如果这仍然不起作用,请检查文件权限:运行口是心非的用户是否对上面指定的配置文件有足够的权限?
关于python - Pydrive 后端不适用于口是心非——python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35528278/
尝试使用 Duplicity 备份到 CloudFiles 时,我收到以下输出: Traceback (most recent call last): File "/usr/bin/duplici
我有一个带有 CheckGroup 的简单面板(面板本身是更大表单的一部分)。检查组中的复选框是在 ListView 组件中生成的。我需要动态更改此面板,每次更改时我都需要检索所选项目。面板的代码基本
我尝试使用以下命令作为示例从亚马逊恢复我的备份 duplicity restore --sign-key '7F73FA36' --encrypt-key '5FD0100F' scp://rich@
我是一名优秀的程序员,十分优秀!