PDA

View Full Version : [ViX_Misc] How can I install Python modules?



point17
02-04-24, 14:46
Apologies if this question is posted in the wrong place - this seemed the least inappropriate.

I'm looking to run some Python scripts on my PVR's (one Vu, one GigaBlue, one Miraclebox). These are scripts that I am developing on a Windows PC. The scripts require and hence import a number of standard Python modules (eg. "yaml") and when I run the scripts on the PVR they immediately fail when trying to import the yaml module.

On my Windows box I use a utility called pip to install standard Python modules but I can't find pip on the OpenVix PVR. I've tried "opkg install yaml" but it couldn't find anything to match. From a ChatGPT suggestion I also tried downloading "get-pip.py" and running that but it failed with "No module named 'py_compile'".

Can anyone please help by pointing me to how I should install standard Python modules on an OpenVix PVR?

Many thanks,
Dan

birdman
02-04-24, 18:21
The first thing to realize is that if you are installing other Python modules you should not install them to the standard system locations, as if you do they will be removed any time you flash a new installation.

Huevos
02-04-24, 20:55
If you want modules that are not there you either need to install manually, or build your own images.

point17
03-04-24, 16:51
Thanks for the responses. I've been working away at trying to get things working and have been mainly successful on my Vu duo4kse. I was able to get PIP running eventually and use pip to install most of what I need. I will modify my code to circumvent the rest.

I then turned my attention to the second of my PVR's - a GigaBlue X2 running OpenViX 6.2.011 (I think that's the latest version supported for this box). On the GigaBlue I'm running into additional problems installing the python3-xmlrpc package with opkg. This needs to be installed to get pip working. I have run "opkg update" and can see the package in the output from "opkg list", but when I run "opkg install python3-xmlrpc" I get the following:

Installing python3-xmlrpc (3.10.4) on root.
Downloading http://www.openvix.co.uk/feeds/openvix/release/6.2/gb73625/mips32el/python3-xmlrpc_3.10.4-r0_mips32el.ipk.
* opkg_download_backend: Failed to download http://www.openvix.co.uk/feeds/openvix/release/6.2/gb73625/mips32el/python3-xmlrpc_3.10.4-r0_mips32el.ipk, wget returned 8.
* opkg_install_pkg: Failed to download python3-xmlrpc. Perhaps you need to run 'opkg update'?
* opkg_solver_install: Cannot install package python3-xmlrpc.

I've looked on the openvix server and, sure enough, the "6.2" directory is not there - there's directories for 6.3, 6.4, and 6.5 but no earlier ones.

If I knew how I would redirect opkg to get the file from the 6.3 directory instead but opkg is a bit of a black box. Is it possible for the 6.2 directory to be restored so that I can get through this hurdle?

Thanks,
Dan

birdman
04-04-24, 01:48
If I knew how I would redirect opkg to get the file from the 6.3 directory instead but opkg is a bit of a black box.Given that they are both mips32el you could try downloading the 6.3 version for gb73625 and install that.

Mind you, it has dependencies for:

python3-compression, python3-core, python3-crypt, python3-datetime, python3-email, python3-html, python3-io, python3-math, python3-mime, python3-netclient, python3-netserver, python3-numbers, python3-pydoc, python3-stringold, python3-xml
so this could lead to a lot of manual downloads.

abu baniaz
04-04-24, 06:52
Maybe build ViX images yourself or install another image with active feeds for the receivers such as ATV 7.3?