最近打算做一个小工具,准备用Python来配合实现,本地的硬件设备准备用Banana Pi M3,首先要做的事情就是搭好环境。
其实我已经有几个M3在跑Python3,以前也写过在Banana Pi M3上编译Python 3.5.x 3.6.x的笔记,但是按照以往的步骤安装,会出一些小问题。
安装的详细步骤参见:How to install python 3.5 on Banana-Pi M3 / 如何香蕉派上的安装python 3.5
需要做的修改:
- 把上述笔记中的
3.5.3
替换成3.7.3
- 安装如下依赖:
sudo apt-get install libffi-dev uuid-dev
如果不做第二步,则会出现安装失败。
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
Makefile:1080: recipe for target 'install' failed
make: *** [install] Error 1
据说可以在给./configure
加上参数--without-ensurepip
,来绕过pip的检查,不过感觉有些不完美,所以还是装上libffi-dev
和uuid-dev
吧。
在Banana Pi M3编译3.5.3报的错误倒是没有出,怀疑和我没开启如下优化相关:
If you want a release build with all stable optimizations active (PGO, etc),
please run ./configure –enable-optimizations
可是编译完成后,发现ssl模块出错了
Could not build the ssl module!
Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host().
LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/portable/issues/381
哎,心累,先不管了,就这样了,回头试试我的项目能不能正常部署,不行的话再降级Python吧,哈哈。
相关链接
- How to install python 3.5 on Banana-Pi M3 / 如何香蕉派上的安装python 3.5
- https://bugs.python.org/issue32401
- https://bugs.python.org/issue31652
- https://github.com/libressl-portable/portable/issues/381
https://steemit.com/~witnesses type in
oflyhigh
and click VOTE
Vote @oflyhigh via Steemconnect
Thank you!
This page is synchronized from the post: ‘在Banana Pi M3上Build Python 3.7.3’