Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include Python pip3 modules in OpenWRT image

Tags:

openwrt

I'm going to include pip3 modules in OpenWRT image, so it won't require other dependencies after installed OpenWRT image.

For example, I'm going to include argparse module in OpenWRT image. This module may be installed by the following command in initial OpenWRT image:

opkg install python3
pip3 install argparse

How can I include them in initial OpenWRT firmware?

Thanks!

like image 760
cdevman Avatar asked Sep 03 '26 10:09

cdevman


1 Answers

First, run make menuconfig, and then select Languages -> Python, and then select python3,python3-pip, then save and then exit.

Next, run ./scripts/env new py3-argparse to create a build environment for your changes.

Finally, download the argparse library and place it in files/lib/python3.6/site-packages.

References:

OpenWrt - Build Environments

Python3 - argparse (source)

like image 173
oxr463 Avatar answered Sep 05 '26 15:09

oxr463



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!