Sources for python2 and a precompiled version for use on newer linux systems

@tundra tundra authored 24 days ago
Python-2.7.18.tgz initial load of python2 sources and precompiled linux version installed under /usr/local/ 24 days ago
README.md add tk-dev and tcl-dev to list of sofware to install for rebuild, reformat list for readibility 24 days ago
python2-tk.tar.gz initial load of python2 sources and precompiled linux version installed under /usr/local/ 24 days ago
README.md

python2-tk

Since python2 has long been deprecated, new linux distributions are no longer making it available in their repositories.

Unfortunately, some useful tools never got migrated to python3 and have therefore been made orphans.

This repo may fix this for you. Included is the source code for python 2.7.18 and well as a tarball of a precompiled version that can just be untarred from / to install in /usr/local/. It was built in a docker image running on Linux Mint 22 and then transfered (via this tarball) into the base system. This seems to work fine, at least as of this writing.

Installation

WARNING:

python2 has not been supported for many years. Installing it on your system as described below may expose you to security compromise. Use wisely and at your own risk!!!

To install:

# become root
sudo su -

# make a backup, just in case
tar -czvf original-usr-local.tar.gz /usr/local/

# install it
cd /
tar -xvf python2-tk.tar.gz

exit

You should now have a running python2.7 with tkinter support in /usr/local/bin.

Rebuilding From Source

It may be necessary to rebuild this from time to time as the base system gets upgraded or rebuilt. The easiest way to do this in a docker container or VM running the base system version of your choice.

Once you have that running, the rebuild looks like this:

# become root
sudo su -

# install the supporting packages and libraries
apt install --fix-missing build-essential libssl-dev zlib1g-dev \
                          libbz2-dev libreadline-dev libsqlite3-dev \
                          wget curl llvm libncurses5-dev libncursesw5-dev \
                          xz-utils tk-dev libffi-dev liblzma-dev tk-dev tcl-dev

# untar the source code
tar -xvf Python-2.7.18.tgz
cd Python-2.7.18

# configure and build python2
./configure --enable-optimizations --with-tk
make

# install it at an alternate location
make altinstall

exit