Building the latest python from source as an alternative on OpenSuse Leap 15.1

When building the latest python from source as an alternative:

    1. Download the source to a local directory. Get latest sources from here
    2. Extract and expand the tar from the local directory:tar xf Python-3.8.1.tar.xz
    3. Enter in the new source directorycd Python-3.8.1
    4. Before running the configure script, it is necessary to add development libraries that the configure can find, like
      1. xz-devel
      2. lzma-sdk-devel
      3. tk-devel
      4. tcl-devel
      5. gtk2-devel
      6. lzlib-devel
      7. sqlite3-devel
      8. libffi-devel
      9. readline-devel
      10. libbz2-devel
      11. libopenssl-devel
    5. Run the configure script with a –prefix for where the install will go:configure --enable-optimizations --prefix=/opt/python-3.8.1
    6. Make the project in parallel:make -j4
    7. Wait for the end of the make and check at the end for possible missing modules. If any module looks important, install them (the source devel module) going back to step 4.
    8. When happy perform the alternative install by:sudo make altinstall
    9. Now, very important, create a soft link in the target installation for lib-dynload:ln -s /opt/python-3.8.1/lib64/python3.8/lib-dynload /opt/python-3.8.1/lib/python3.8/lib-dynload. This is required at runtime to manage to find share libraries that are built on 32 bit like when doing import struct
    10. Create a python virtual environment in the home directory:virtualenv venv/py38 -p /opt/python-3.8.1/bin/python3.8