教程集 www.jiaochengji.com
教程集 >  Python编程  >  Python入门  >  正文 openwrt如何安装python

openwrt如何安装python

发布时间:2021-05-05   编辑:jiaochengji.com
教程集为您提供openwrt如何安装python等资源,欢迎您收藏本站,我们将为您提供最新的openwrt如何安装python资源

首先配置opkg源。

# 备份初始conf
mv /etc/opkg.conf /etc/opkg.conf.bak
# 新建配置
vim /etc/opkg.conf
# 添加如下内容:
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay
# notice
dest usb /mnt/sdb1/opkg
arch all 100
arch ramips_24kec 200
arch ramips 300
arch mips 400
arch unkown 500
src/gz barrier_breaker_base http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/base
src/gz barrier_breaker_luci http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/luci
src/gz barrier_breaker_management http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/management
src/gz barrier_breaker_oldpackages http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/ 
oldpackages
src/gz barrier_breaker_packages http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/packages
src/gz barrier_breaker_routing http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/routing
src/gz barrier_breaker_telephony http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/telephony
# wq保存
# 执行升级
opkg update

相关推荐:《Python入门教程》

安装Python

需要注意的是,小米路由器的可用空间不多,但Python的安装会占用挺大的空间,所以我们指定opkg将程序安装在U盘或硬盘上。

这时我们回到刚才的配置文件里,找到notice,这里的dest usb /mnt/sdb1/opkg就是指定变量usb为外置存储路径/mnt/sdb1/opkg。外置存储的路径可以用df -h查看。

以后我们使用opkg -d usb install xxx即可将程序安装至/mnt/sdb1/opkg。

# 先需要安装libc,需要下载下来安装
## 建立文件夹
mkdir -p /mnt/sdb1/opkg/src
cd /mnt/sdb1/opkg/src
wget http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/base/libc_0.9.33.2-1_ramips_24kec.ipk
## 安装libc,最好安装到根下
opkg install libc_0.9.33.2-1_ramips_24kec.ipk
 
# 接着安装Python
opkg -d usb install libreadline
opkg -d usb install python
opkg -d usb install python-json
opkg -d usb install python-curl
opkg -d usb install python-openssl
 
# 路径
export PATH=$PATH:/mnt/sdb1/opkg/usr/bin
echo 'export PATH=$PATH:/mnt/sdb1/opkg/usr/bin' >> /etc/profile
 
# 别名
echo "alias opintall='opkg -d usb install'" >> /etc/profile

您可能感兴趣的文章:
openwrt如何安装python
python如何导入request包
centos如何安装python2.7
ubuntu如何查看python是否已安装
mac如何安装python包
如何用python操作word文档
如何下载django
Windows安装Python详解
mac上如何安装python3
windows如何安装python框架

[关闭]
~ ~