如何在 RPI2 Buildroot 中获取 gmpy2 模块

How to get the gmpy2 module in RPI2 Buildroot

我无法让 gmpy2 Python 模块在 Raspberry Pi2 的 Buildroot 构建中工作。默认情况下,Buildroot 不包含 gmpy2 模块。

Buildroot 也不包含 GCC,因此我在另一块 RPI2 板(具有相同的 Python 版本 -- 3.7.2 -- 作为Buildroot 板)并将生成的 gmpy2.cpython-37m-arm-linux-gnueabihf.so 复制到 Buildroot 板的 /usr/lib/python3.7/site-packages/ 并将 link gmpy2.so 放在同一目录中。

我希望 Python 能够看到该模块,但我却得到:

# python3
Python 3.7.2 (default, Apr 10 2019, 23:36:01)
[GCC 7.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gmpy2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: File not found
>>>

非常感谢任何帮助!

要为 gmpy2 创建一个实际的 Buildroot 包,运行 utils/scanpypi gmpy2 应该足够了。确保 package/python-gmpy2/Config.in 来自 package/Config.in,然后您可以从 menuconfig 以正常方式 select 它。

如果一切正常,请send the patch to the Buildroot mailing list上游收录。感谢您的贡献!