This will help to install python 3 (multiple version) on Centos
as you know, Centos by default has python 2 installed, if you need to run python 3 then this step is for you
go inside to configure and install from python source
additionally you need to check PATH and export if necessary, check it with
and don't forget to check the pip too
as you know, Centos by default has python 2 installed, if you need to run python 3 then this step is for you
Requirements
openssl-devel is required by pip to be installed, run this code to install openssl-develyum install gcc openssl-devel
Installation
I recommend to go to /usr/src folder to download and extract the source, you can choose other directorycd /usr/src wget https://www.python.org/ftp/python/3.4.4/Python-3.4.4.tgz tar xzf Python-3.4.4.tgz
go inside to configure and install from python source
cd Python-3.4.4 ./configure make altinstallmake altinstall is used to prevent replacing the default python binary file /usr/bin/python.
additionally you need to check PATH and export if necessary, check it with
echo $PATHif result is does not contain /usr/local/bin
export PATH=$PATH:/usr/local/bin
Test
you can test it by activating python version query# python3.4 -V Python 3.4.4
and don't forget to check the pip too
# pip3.4 -V pip 7.1.2 from /usr/local/lib/python3.4/site-packages (python 3.4)
No comments :
Post a Comment