DEV Community

Vee Satayamas
Vee Satayamas

Posted on • Updated on

Installing Python 3.10 on openSUSE Leap 15.3

Prerequisites

sudo zypper install gcc-c++ make gcc automake autoconf libtool aclocal
sudo zypper si -d python3
Enter fullscreen mode Exit fullscreen mode

Download and unarchive

Download Python-3.10.0.tar.xz; tar xJvf Python-3.10.0.tar.xz; cd Python-3.10.0

Configure

I got this error message by running ./configure

./configure: line 10530: PKG_PROG_PKG_CONFIG: command not found
Enter fullscreen mode Exit fullscreen mode

So I ran this:

docker run --rm --pull=always -v $(pwd):/src quay.io/tiran/cpython_autoconf:latest
Enter fullscreen mode Exit fullscreen mode

Still configure cannot find g++, so I added CXX=c++ in front of configure.

So this was how I used configure:

CXX=c++ ./configure --enable-optimizations --prefix=/opt 2> elog > log
Enter fullscreen mode Exit fullscreen mode

make

This step has no problem.

make -j8
sudo make install
Enter fullscreen mode Exit fullscreen mode

Running python

pip3.10 and python3.10 cannot run since it can't find readline.

So I ran this.

ln -s /opt/lib64/python3.10/lib-dynload /opt/lib/python3.10/lib-dynload
Enter fullscreen mode Exit fullscreen mode

Then python3.10 works now.

P.S. Thank every one who provide answers on issue trackers and forums. I should have kept URLs to those. Sorry that I didn't.

Top comments (0)