将python3包添加到Buildroot

时间:2018-02-19 13:38:06

标签: buildroot

Buildroot 是一个可用于为嵌入式系统板构建Linux映像的工具。

Buildroot附带了一组预定义的Python软件包,可以从菜单中选择。

此外,Buildroot还添加了一个很好的Python脚本,可以导入任何属于PyPI存储库的包,称为“scanpypi”。

然而,似乎该脚本仅适用于Python2。尝试导入较新的包时,会出现错误,例如:

./support/scripts/scanpypi websockets -o package
buildroot package name for websockets: python-websockets
Package: python-websockets
Fetching package websockets
Downloading package websockets from https://pypi.python.org/packages/b6/12/6194aac840c65253e45a38912e318f9ac548f9ba86d75bdb8fe66841b335/websockets-4.0.1.tar.gz...
Traceback (most recent call last):
  File "./support/scripts/scanpypi", line 653, in <module>
    main()
  File "./support/scripts/scanpypi", line 604, in main
    package.load_setup()
  File "./support/scripts/scanpypi", line 250, in load_setup
    setup = imp.load_module('setup', s_file, s_path, s_desc)
  File "/tmp/scanpypi-qbY6eQ/python-websockets/websockets-4.0.1/setup.py", line 11, in <module>
TypeError: 'encoding' is an invalid keyword argument for this function

这个无效的关键字失败了。

此外:

./support/scripts/scanpypi websocket-server -o package
buildroot package name for websocket-server: python-websocket-server
Package: python-websocket-server
Fetching package websocket-server
Downloading package websocket-server from https://pypi.python.org/packages/74/64/e86581ee7775a2e08aca530b41e1a1e3ee6b320233b1eff301dcb86d1636/websocket_server-0.4.tar.gz...
Traceback (most recent call last):
  File "./support/scripts/scanpypi", line 653, in <module>
    main()
  File "./support/scripts/scanpypi", line 604, in main
    package.load_setup()
  File "./support/scripts/scanpypi", line 247, in load_setup
    os.chdir(self.tmp_extract)
OSError: [Errno 2] No such file or directory: '/tmp/scanpypi-YXROmL/python-websocket-server/websocket-server-0.4'

这个包含下划线(_)而不是破折号( - )的包名失败。

1 个答案:

答案 0 :(得分:1)

我为scanpypi创建了一个Python3移植。

请参阅https://github.com/ishahak/buildroot_scanpypi3

修改

根据@yegorich的要求,我很高兴地告知现在scanpypi可用于Python 2/3!

我的链接版本仍可用于直接从GitHub安装较新版本。