Tiny Core Base > TCB Talk
my adventures with installing python3.9 on TC15
Stefann:
Well.... I got it working!
And thanks Juanito for pointing me in the right direction.
here is how I fixed things......
1/ closing remark last post: (it of course does not help that I'm an absolute beginner in python and also no big linux hero)
I improved on that by reading a lot about pip.
2/ As I more or less concluded yesterday...
The "python3.9 setup.py build" method is vey cumbersome.
It runs from dependancy into dependancy.
And newer packages donot even have a "setup.py" script anymore.
3/ So I started from scratch again.
Removed all python stuff, started with a clean sheet.
>>> and this is why I really like tiny core... If your system is cluttered after few days of fiddling around with installs it's very easy to start from scratch again.
I decided to go for the pip route....
note: I do the package handling from the GUI as I donot feel super secure with command line with those. That's why you do not see command line commands for the package handling
First... get a recent pip........
--- Code: ---python3.9 -m ensurepip
cd /tmp
mkdir pkg
python3.9 -m pip install --upgrade pip --root /tmp/pkg
delete all of the __pycache__ subdirectories under /tmp/pkg/usr/local/lib/python3.9/site-packages/pip
sudo mksquashfs pkg/ python3.9-pip.tcz
cp *tcz /mnt/sda1/tce/optional
add python3.9-pip.tcz to onboot.lst
reboot WITHOUT backup >> to avoid that the files in ~/.local are backed up
---
tc@hp510:/tmp$ python3.9 -m pip --version
pip 25.0.1 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)
--- End code ---
Huray!!! i got an upgraded pip in the normal location!
Explanation:
The 1st "ensure pip" got me a basic pip.
It got installed in my ~/.local but that does not hurt because by rebooting without backup all that got deleted
The 2nd "--upgrade pip" got installed to /tmp/pkg
From there its a quiet straightforward tcz generation
Note: the upgraded pip "cannot run" form /tmp/pkg because /tmp/pkg is not in the search path
So.. I did need to create the tcz, add to onboot.lst and reboot to get a functional pip
By rebooting without backup "no trash" was pulled in, the 1st "ensure pip" got flushed.
4/ with rebooted system got the modules I need:
--- Code: ---python3.9 -m pip install python_dateutil==2.8.2 --root /tmp/pkg
python3.9 -m pip install beautifulsoup4==4.11.1 --root /tmp/pkg
python3.9 -m pip install pytz==2022.2.1 --root /tmp/pkg
python3.9 -m pip install requests==2.28.1 --root /tmp/pkg
python3.9 -m pip install paho_mqtt==1.6.1 --root /tmp/pkg
delete all of the __pycache__ subdirectories under /tmp/pkg/usr/local/lib/python3.9/site-packages/*
sudo mksquashfs pkg/ python3.9-goodies2.tcz
cp *tcz /mnt/sda1/tce/optional
add python3.9-goodies2.tcz to onboot.lst
reboot WITHOUT backup >> to avoid that the files in ~/.local are backed up
--- End code ---
tested python application >> yess works!!!
Conclusion:
- all are now in standard /usr/local/lib/python3.9/site-packages/* folder >> good!
- I decided to get pip in a dedicated python3.9-pip.tcz because I expect to need pip more often and unrelated to current application
- I decided to do all modules I need in 1 goodies2.tcz for reason that pip made sure version conflicts got resolved. I could have done a tcz per modules. Its ok for me like this
As said, thanks Juanito for pointing me in the right direction
Pablo.03:
Great job getting Python 3.9 installed on TC15! The 3.6 residue is pretty typical, especially with updates. If you want to clean it up, go ahead and try removing the old versions and syncing the paths. As for pip, you're right that local install is generally best, but it actually works!
PS: Maybe make.tcz packages for those modules instead, it would be cleaner. :)
Navigation
[0] Message Index
[*] Previous page
Go to full version