Tiny Core Base > TCB Talk
my adventures with installing python3.9 on TC15
Stefann:
Hi,
This weekend I succeeded in getting python3.9 on TC15 TinyCore.
I would like to share my experiences because it was not a completely smooth ride.
I will skip all detours I made and just get to how I finally succeeded.
Note that I run my system frugal: with tc home directory in ram.
--- Code: ---got python3.9 on by getting python3.9-setuptools.tcz downloaded and "on demand"
check:
tc@hp510:~$ python3 --version
Python 3.6.15
tc@hp510:~$ python3.9 --version
Python 3.9.18
--- End code ---
note: not sure I would need the setup tools. I installed them just to be sure.
strangly enough the 3.9 not only installs 3.9 but also some 3.6 residuals:
--- Code: ---tc@hp510:/usr/local/bin$ ls -al python3*
lrwxrwxrwx 1 root root 9 Mar 22 12:47 python3 -> python3.6
lrwxrwxrwx 1 root root 16 Mar 22 12:47 python3-config -> python3.6-config
-rwxr-xr-x 2 root root 13760 Dec 7 2023 python3.6
lrwxrwxrwx 1 root root 17 Mar 22 12:47 python3.6-config -> python3.6m-config
-rwxr-xr-x 2 root root 13760 Dec 7 2023 python3.6m
-rwxr-xr-x 1 root root 3061 Dec 7 2023 python3.6m-config
-rwxr-xr-x 1 root root 13728 Jan 27 2024 python3.9
-rwxr-xr-x 1 root root 3034 Jan 27 2024 python3.9-config
--- End code ---
after that I did need some modules that are not offered as tcz.
I tried "pip" but that did not work
I succeeded getting pip by:
--- Code: ---python3.9 -m ensurepip --default-pip
python3.9 -m pip install --upgrade pip
This did NOT install pip in /usr/local but in my tc home directory:
tc@hp510:~/.local/lib/python3.9/site-packages
--- End code ---
After that I successfully installed some modules:
--- Code: ---python3.9 -m pip install python_dateutil==2.8.2
python3.9 -m pip install beautifulsoup4==4.11.1
python3.9 -m pip install pytz==2022.2.1
python3.9 -m pip install requests==2.28.1
python3.9 -m pip install paho_mqtt==1.6.1
all got installed in:
~/.local/lib/python3.9/site-packages
--- End code ---
As I run with home in RAM (so, not persistent) this would unnecessarily increase the backup for home
I solved that by following "Chapter 14. Creating a personal (data) extension" from the core book to create a data extension for the content of ~/.local/lib/python3.9/site-packages and adding home/tc/.local/lib/python3.9/site-packages to .xfiletool.lst.
So...
This all works...
But it's not super clean
What I would hope (actually not for me as I'm fine now, but probably for others)
- cleanup the python3.9 tcz package such that no 3.6 stuff is created
- update pip in python3.9 tcp package such that it works out of the box, and not installs on ~/.local
Next to that..
- creating a data extension for ~/.local/lib/python3.9/site-packages is a bit ugly.
- it would be better to create tcz program extensions for the modules
I'm afraid all of these are at this moment beyond my capabilities.
Actually... I feel that "if I would have installed the modules under root", they would have landed in /usr/local/lib/python3.9/site-packages from which either a data-extension or program extension would have been a much cleaner approach.
However.... running pip under root gives a fat warning that it may corrupt python. So... I did not dare to do.
All in all:
I'm totally happy now.
Fixing all of the above is really beyond my capabilities so I'm afraid I cannot assist to fix.
So with that said: Either consider this an instruction guide towards pyhton3.9 install OR a suggestion for fix.
Juanito:
The tree file for python3.9-setuptools in the tc-15.x x86 repo does not contain any references to python3.6.
This means that some other extension you are loading is pulling in python3.6.
Stefann:
Mhh strange…
I thought I checked that.
But as I said… it was a full Saturday of hobbying until I had it working.
I tried to make it a “clean story” but I may have done something wrong.
I will check again tomorrow and report back.
Stefann:
OK, you are right.
Don't understand it because I thought I had checked this !!!!!!
But anyways..
--- Code: ---run visual apps browser
click "dependancies"
click "python3.6.tcz"
click "required by"
- libxml2-dev.tcz. >> required by php-8.3-dev.tcz
- libxml2-python.tcz. >> required by php-8.3-dev.tcz
- php-8.3-dev.tcz. >> yes I have installed that
- python3.6-pip.tcz
- python3.6-setuptools.tcz
--- End code ---
so, yes I have php-8.3-dev.tcz installed.
I use php, but not sure I also need the -dev module. I merely loaded it "just to be sure".
Next step
--- Code: ---removed php-8.3-dev.tcz from on demand list.
reboot with backup
tc@hp510:/usr/local/bin$ ls py* -al
lrwxrwxrwx 1 root root 8 Mar 24 17:55 pydoc3 -> pydoc3.9
-rwxr-xr-x 1 root root 84 Jan 27 2024 pydoc3.9
lrwxrwxrwx 1 root root 9 Mar 24 17:55 python3 -> python3.9
lrwxrwxrwx 1 root root 16 Mar 24 17:55 python3-config -> python3.9-config
-rwxr-xr-x 1 root root 13728 Jan 27 2024 python3.9
-rwxr-xr-x 1 root root 3034 Jan 27 2024 python3.9-config
--- End code ---
so.. yesss... python3.6 disappeared!
I only use php inside apache webserver.
I checked my application
webpage still seems to function.
So... keep it off for now.
That's solves 1 thing!
Happy with it. don't like to have 2 versions of python on my system, so thanks Juanito
now... python3.9 apparently is also installed even though I did not install it.
--- Code: ---Checked "required by"
- indeed many "required by's"
- especially "libusb-compat-dev.tcz" >>> yes... and I sure need that one
--- End code ---
So now it remains a bit unclear why I did need to upgrade pip >> I'm not going to look into that, I'm happy it works
And a bit ugly to have pip & extra modules under ~/.local >> I will live with that.
Juanito:
There are 15+ python3.9 extensions in the tc-15.x x86 repo.
If you don't see the one you need, it's not difficult to make a python extension.
Taking as an example python certifi:
--- Code: ---tce-load -i compiletc python3.9-dev squashfs-tools
wget https://files.pythonhosted.org/packages/71/da/e94e26401b62acd6d91df2b52954aceb7f561743aa5ccc32152886c76c96/certifi-2024.2.2.tar.gz
tar xf certifi-2024.2.2.tar.gz
cd certifi-2024.2.2
python3.9 setup.py build
sudo python3.9 setup.py install --root=/tmp/pkg
--- End code ---
Then delete all of the __pycache__ subdirectories under /tmp/pkg/usr/local/lib/python3.9/site-packages
Finally make an extension:
--- Code: ---cd /tmp
sudo mksquashfs pkg/ python3.9-certifi.tcz
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version