Leanest python
-
I have an original Omega from the kickstarter, and an Omega 2, so already we know that space is at a premium.
Of course, I can
opkg install python-light
and that works. The trouble is that I can never finish installing
opkg install python-pip
without it running out of space. It would appear that I'm installing a lot of modules. I really only want the time and requests module. The output shows downloads of codecs, installs and configuring. Then the errors roll in.Perhaps I can remove these codecs?
I factory reset the Omega and attempting to get what I need from installing micropython and its micropython-lib. While that lib would seem to have included urequests, following the comments in the module it would appear that micropython is unable to find what it downloaded.
Of course, this shows that I don't know how to manage python and is why I'm asking how to get a lean python on the limited storage of the Omega without throwing away in favor of the 2+? How would you get requests working on it? I'm avoiding ESP32 because I've found the Omega's wifi far more reliable, sam
-
This post is deleted!
-
@sam-walton said in Leanest python:
How would you get requests working on it?
If you're still using python2, you can use opkg to install the
python-urllib3
package for http requests. Should fit on the 16MB storage on the Omega2If you're on python3, try listing out the packages available
opkg list | grep python3
-
@Stanton Thank you. Running
opkg update opkg list | grep lean
returns a list of libraries that have the word "lean" in them. The only thing I see with python is micropython.
Is there an actual library called python-lean ? If so, it does not appear to be available to me?
-
@Lazar-Demin
Thank you for replying. To be certain I am not missing out on any libraries, I've uncommented all lines using
vi /etc/opkg/distfeeds.conf
opkg update
opkg list | grep urllib
returns no results. Certainly not when I attempt to install python-urllib3.
Again, this is after a factory reset of this Omega. Checking for any firmware upgrade returns
"no upgrade required" for this 0.1.4 (b330).
So something is preventing me from seeing this python-urllib3 to let opkg install.
-
This post is deleted!
-
@Lazar-Demin
It would appear that my original Omega does not have access to these libraries. I swapped it out with a newer Omega2 which appears to have the same storage space. Doing a factory reset on it, using the Arduino Dock 2, I find that python-urllib3 is available.opkg update
opgk install python-urllib3
is found and helpfully attempts to install python-light as well.
Unfortunately, it fails due to the same problem that python-light and perhaps the urllib3 is too much for the Omega2.
Is that true? Would installing PHP instead of Python fit on an Omega2 ?
-
@sam-walton said in Leanest python:
It would appear that my original Omega does not have access to these libraries. I swapped it out with a newer Omega2 which appears to have the same storage space
Sorry, should have mentioned this advice is for the Omega2/2+ and does not apply to the original Omega
@sam-walton said in Leanest python:
Unfortunately, it fails due to the same problem that python-light and perhaps the urllib3 is too much for the Omega2.
Is that true? Would installing PHP instead of Python fit on an Omega2 ?Not sure of the top of my head. I would suggest grabbing an Omega2+ and trying everything out. Then working backwards to make it fit on the Omega2 if that's a requirement.