Buildroot 中的 Python - PyDrive 错误
Posted
技术标签:
【中文标题】Buildroot 中的 Python - PyDrive 错误【英文标题】:Python in Buildroot - PyDrive errors 【发布时间】:2018-06-02 04:48:23 【问题描述】:我正在尝试在我的 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
【问题讨论】:
【参考方案1】:您缺少BR2_PACKAGE_PYTHON_HASHLIB
选项。执行以下操作:
make menuconfig
启用此选项
删除你的目标 Python rm -fr output/build/python-2.7*
调用 make
使用 hashlib 模块重建 Python
【讨论】:
以上是关于Buildroot 中的 Python - PyDrive 错误的主要内容,如果未能解决你的问题,请参考以下文章
如何在 Windows 8.1 中的 anaconda(python3.6) 中将 cython pyx 构建为 pyd?
Python关于.pyd文件无法import的问题的解决方法