在Banana Pi M3上Build Python 3.7.3

in #cn5 years ago

最近打算做一个小工具,准备用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-devuuid-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吧,哈哈。

相关链接


Vote For Me As Witness
https://steemit.com/~witnesses type in oflyhigh and click VOTE

Vote @oflyhigh via Steemconnect
Thank you!

Sort:  

Thank you so much for participating in the Partiko Delegation Plan Round 1! We really appreciate your support! As part of the delegation benefits, we just gave you a 3.00% upvote! Together, let’s change the world!

Coin Marketplace

STEEM 0.20
TRX 0.14
JST 0.030
BTC 63718.61
ETH 3390.60
USDT 1.00
SBD 2.62