Buildroot 中的 Python - PyDrive 错误

标签 python linux python-2.7 buildroot pydrive

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

我收到以下错误:

# 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

最佳答案

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

  • 通过make menuconfig启用此选项
  • 删除目标 Python rm -fr output/build/python-2.7*
  • 调用make用hashlib模块重建Python

关于Buildroot 中的 Python - PyDrive 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47892254/

相关文章:

python - 关于多站点的一般想法

python - python中关键字参数值的命名空间是什么?

linux - Linux 上的 load_model 上的 Keras 段错误,而不是 Windows 上的

linux - Linux/Unix下的wxCriticalSection

python - bash 命令通过 cli 正常运行但不在 python 脚本中运行

python - 如果第 N 个索引应大于前一个,如何检查索引

python - Python "If...elif...else"循环 1,500 个选项的替代技术

linux - 存储 linux 守护进程所需的密码

python - 如何生成词频直方图,其中条形根据高度排序

python - 如何解决 python 代码运行缓慢的问题