3

我正在尝试在使用 PyDrive 的 buildroot 目标中使用应用程序。

我收到以下错误:

# python driveapp.py
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "usr/lib/python2.7/hashlib.py", line 147, in <module>
  File "usr/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
  File "usr/lib/python2.7/hashlib.py", line 147, in <module>
  File "usr/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
  File "usr/lib/python2.7/hashlib.py", line 147, in <module>
  File "usr/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
  File "usr/lib/python2.7/hashlib.py", line 147, in <module>
  File "usr/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
  File "usr/lib/python2.7/hashlib.py", line 147, in <module>
  File "usr/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
  File "usr/lib/python2.7/hashlib.py", line 147, in <module>
  File "usr/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
ValueError: unsupported hash type sha512
Traceback (most recent call last):
  File "driveapp.py", line 1, in <module>
    from pydrive.auth import GoogleAuth
  File "usr/lib/python2.7/site-packages/pydrive/auth.py", line 3, in <module>
  File "usr/lib/python2.7/site-packages/httplib2/__init__.py", line 51, in <module>
  File "usr/lib/python2.7/sha.py", line 10, in <module>
ImportError: cannot import name sha1

我缺少哪些模块?任何人都可以帮忙吗?

DD

4

1 回答 1

5

您缺少BR2_PACKAGE_PYTHON_HASHLIB选项。执行以下操作:

  • 通过 enebale 这个选项make menuconfig
  • 删除你的目标 Pythonrm -fr output/build/python-2.7*
  • 调用make以使用 hashlib 模块重建 Python
于 2017-12-20T08:49:13.197 回答