[Pico Ultra RV1106] Add Python Library
-
Hello, I'm new with Linux and RK1106. Can I ask how to import python library like opencv, flask,flask socket in case that library cant found in menuconfig ? And how to compile or run python code on board ? I had follow RV1103/RV1106 RKNN SDK Quick Start and run success python example ( yolov5) but in still not clear how to run my own code, please help me. Thanks
Luckfox Pico Ultra has three methods for installing Python libraries, corresponding to two operating systems.
Buildroot System:
The Buildroot system is based on the uclibc cross-compilation toolchain and cannot support Python libraries that depend on glibc.
[/list]Select the corresponding software package in Buildroot's menuconfig. During the compilation process, the software will be cross-compiled and packaged into the rootfs image. After re-flashing, it can be used directly. However, the available software libraries are much fewer than those provided by pip.[/list]
The Ubuntu system is based on the glibc cross-compilation toolchain and supports more software libraries.
Since RV1106 uses RKISP to process camera input data, python-opencv cannot be used to drive the camera.
Python is an interpreted language and relatively inefficient. On a single-core, resource-constrained platform like the Luckfox Pico Ultra, it is not the primary recommended language.
Buildroot System:
The Buildroot system is based on the uclibc cross-compilation toolchain and cannot support Python libraries that depend on glibc.
[/list]Select the corresponding software package in Buildroot's menuconfig. During the compilation process, the software will be cross-compiled and packaged into the rootfs image. After re-flashing, it can be used directly. However, the available software libraries are much fewer than those provided by pip.[/list]
- Select python-pip in Buildroot's menuconfig. After compiling the rootfs image, use pip to install Python libraries in the system. However, since the Luckfox Pico Ultra CPU is single-core with limited memory, local compilation consumes a lot of time and requires resolving errors. This approach is not recommended.
- Obtain the source code of the Python library, cross-compile it to generate a .whl file, and upload it to the Luckfox Pico Ultra to install using pip.
The Ubuntu system is based on the glibc cross-compilation toolchain and supports more software libraries.
- Use apt install python-xxx to install Python libraries, obtaining ARMV7-compatible binary files from the server.
- Install pip using apt install python3-pip, then use pip to install Python libraries. However, local compilation also consumes a lot of time.
- Obtain the source code of the Python library, cross-compile it to generate a .whl file, and upload it to the Luckfox Pico Ultra to install using pip.
Since RV1106 uses RKISP to process camera input data, python-opencv cannot be used to drive the camera.
Python is an interpreted language and relatively inefficient. On a single-core, resource-constrained platform like the Luckfox Pico Ultra, it is not the primary recommended language.
Do you have documents about this step
"Obtain the source code of the Python library, cross-compile it to generate a .whl file, and upload it to the Luckfox Pico Ultra to install using pip"
Let me ask more if I can't use opencv then can I use any library instead, I need to get video from rtsp link
"Obtain the source code of the Python library, cross-compile it to generate a .whl file, and upload it to the Luckfox Pico Ultra to install using pip"
Let me ask more if I can't use opencv then can I use any library instead, I need to get video from rtsp link
Last edited by quocan123 on 2025-03-12 4:51, edited 1 time in total.
There is only one solution provided here, and no detailed operation documentation is provided.Compiling from source code to WHL libraries is covered in Google or StackOverflow.
Getting video from RTSP is not friendly to RV1106, because RV1106 only supports hardware encoding and does not support hardware decoding. Software decoding is not used with opencv, the more common ones are ffmpeg and live555 (mainly C/C++ development)
Getting video from RTSP is not friendly to RV1106, because RV1106 only supports hardware encoding and does not support hardware decoding. Software decoding is not used with opencv, the more common ones are ffmpeg and live555 (mainly C/C++ development)
What happen if i try to install opencv-python with pip install opencv-python command on luckfox pico ultra board ?
My application needs to get video source from CCTV camera rtsp link for processing.
My application needs to get video source from CCTV camera rtsp link for processing.
Last edited by quocan123 on 2025-03-12 6:58, edited 1 time in total.
We haven't measured it and can't speculate what will happen to the installation process, pip installation involves local compilation, which is expected to take a lot of time, and other problems such as installation failure due to insufficient memory