Saturday, April 25, 2020

Python3 Installation on CentOS/Redhat 6 and 7

Download Python3 Software. 

Untar the file.
tar xvf Python-3.7.0.tgz
cd  Python-3.7.0

Now you need to run the ./configure tool to prepare the build: 
./configure --enable-optimizations --with-ensurepip=install --prefix=/app/python3

Next, compile the installation by using make. The -j option simply tells make to split the building into parallel steps to speed up the compilation. Even with the parallel builds, this step can take several minutes:

$ make -j 8

Next, you need to run the installation. You’ll use the altinstall target here in order to not overwrite the system’s version of Python. Since you’re installing Python into /usr/bin, you’ll need to run as root:

$ sudo make altinstall

No comments:

Post a Comment