Sunday, March 1, 2020

Install Python3 on Centos 7

To avoid impact on Centos own Python 2 packages use Python3  venv

Install Python3

$ sudo yum install -y python3


Create venv on Python3

$ python3 -m venv python3-virtualenv

$ pip3 freeze

$ source python3-virtualenv/bin/activate


$ python

Python 3.6.8 (default, Aug  7 2019, 17:28:10) 

[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>> 



On Fedora 31 Python 3 is default


[dave@localhost ~]$ python3

Python 3.7.6 (default, Jan 30 2020, 09:44:41) 

[GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>> 

[dave@localhost ~]$ python2

Python 2.7.17 (default, Oct 20 2019, 00:00:00) 

[GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> 

[dave@localhost ~]$ python

Python 3.7.6 (default, Jan 30 2020, 09:44:41) 

[GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>> 

 

No comments:

Post a Comment