OPERATING SYSTEMSOS Linux

#02 Installing Python on Linux

Chapters
8:41 Applications of Python.
00:00 Intro

02:15 Package Manager
03:24 Source Code
09:08 Recap

How to Install python on linux:
Ubuntu:
$ sudo apt-get update
$ sudo apt-get install python3.9 python3-pip

If you are using a different distribution follow the instructions on the follwing tutorial:
https://realpython.com/installing-python/#how-to-install-python-on-linux

How to build Python from source code:
Step1: download the source code from https://www.python.org/downloads/source/
Step2: prepare your system
#First: make sure to update and upgrade your package manager
$ sudo apt-get update
$ sudo apt-get upgrade

#Second: make sure you have all the build requirements installed
# For apt-based systems (like Debian, Ubuntu, and Mint)
$ sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev
# For yum-based systems (like CentOS)
$ sudo yum -y groupinstall “Development Tools”
$ sudo yum -y install gcc openssl-devel bzip2-devel libffi-devel
Step3: Build Python:
#First: unpack the source into a directory
#Second: run the ./configure tool to prepare the build.
$ ./configure –enable-optimizations –with-ensurepip=install
#Third: build python:
$ make -j 8
#Finally: Install your new Python
$ sudo make altinstall
Step4: Verify your installation
$ python3.9 –version

=============================.
Follow me on social media:
LinkedIn: https://www.linkedin.com/in/omer-maki
Twitter: https://twitter.com/omer_358 .
Facebook: https://web.facebook.com/omermaki358/

source

by OMO Tech

linux foundation

Leave a Reply

Your email address will not be published. Required fields are marked *