How to install python 3.8 directly in /usr/bin?

Trying to install python 3.8 from source in CentOS 7.9.

The default installed python is 2.7.5 and is located at /usr/bin.

sudo yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel
sudo cd /opt
sudo wget
sudo tar xzf Python-3.8.12.tgz
cd Python-3.8.12
sudo ./configure --enable-optimizations
sudo make install

I thought make install would create python3 in /usr/bin, but it didn’t.

>Solution :

By default, CPython install compiled python binary in /usr/local/bin/python. (source code: You may specify the prefix mannually as configure --prefix=/usr.

Leave a Reply