python安装

一、飞凌6818交叉编译安装python

1. 解压

2.编辑Modules/Setup.dist,把需要用到的模块,去掉注释。

我用到的模块

binascii binascii.c
parser parsermodule.c

array arraymodule.c     # array objects
cmath cmathmodule.c _math.c # -lm # complex math library functions
math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
_struct _struct.c       # binary structure packing/unpacking
time timemodule.c # -lm # time operations and variables
_weakref _weakref.c     # basic weak reference support
#_testcapi _testcapimodule.c    # Python C API test module
_random _randommodule.c # Random number generator
_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c  # elementtree accelerator
_pickle _pickle.c       # pickle accelerator
_datetime _datetimemodule.c     # datetime accelerator
_bisect _bisectmodule.c # Bisection algorithms
_heapq _heapqmodule.c   # Heap queue algorithm

unicodedata unicodedata.c    # static Unicode character database


fcntl fcntlmodule.c     # fcntl(2) and ioctl(2)
spwd spwdmodule.c               # spwd(3)
grp grpmodule.c         # grp(3)
select selectmodule.c   # select(2); not on ancient System V

# Memory-mapped files (also works on Win32).
mmap mmapmodule.c

# CSV file helper
_csv _csv.c

# Socket module helper for socket(2)
_socket socketmodule.c



#setup.py需要用到这些库
_posixsubprocess _posixsubprocess.c  # POSIX subprocess module helper

_md5 md5module.c
_sha1 sha1module.c
_sha256 sha256module.c
_sha512 sha512module.c

为了支持中文的decode和encode,下面两个模块也要编译进去。
_multibytecodec cjkcodecs/multibytecodec.c
_codecs_cn cjkcodecs/_codecs_cn.c

###3. 修改
echo ac_cv_file__dev_ptmx=no > config.site
echo ac_cv_file__dev_ptc=no >> config.site
export CONFIG_SITE=config.site

4. 配置

./configure CC=arm-cortex_a9-linux-gnueabi-gcc CXX=arm-cortex_a9-linux-gnueabi-g++ AR=arm-cortex_a9-linux-gnueabi-ar RANLIB=arm-cortex_a9-linux-gnueabi-ranlib --host=arm-cortex_a9-linux-gnueabi -build=mipsel --disable-ipv6 --prefix=/home/xzw/Python-3.4.8/tmp --without-ensurepip

5.编译

make python

6.安装

make install

7.安装psuntil

7.拷贝到飞凌开发板

在飞凌里面创建/usr/local/python34目录,吧tmp里面内容复制进去

  • vi /etc/profile

export PATH="/usr/local/python34/bin:$PATH"
export PATH="/usr/local/python34/lib/python3.4:$PATH"
export PATH="/usr/local/python34/lib/python3.4/site-packages:$PATH"

  • source /etc/profile

二、飞凌直接安装python

参考网页:https://www.cnblogs.com/kimyeee/p/7250560.html

1. 下载源码

https://www.python.org/downloads/source/

失败

三、讯为imx6交叉编译安装PYTHON

同飞凌

问题

1.Ignoring ensurepip failure: pip-8.1.1 requires SSL/TLS

错误解决方案:
apt-get install openssl
apt-get install libssl-dev

发现上面的方法并不能解决,可能是没有交叉编译的原因,最后添加了--without-ensurepip才安装成功

失败,要按装各种库,算了以后直接用python3 setup.py 安装第三方库

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×