Hi, Unable to install python in Ubuntu 19.10

487 Views Asked by At

While trying to download the python package in ubuntu 19.10, got this error. Tried sudo apt-get update, but of no use. How can I install the python in ubuntu server

While trying the download python package in ubuntu 19.10, got this error. Tried sudo apt-get update, but of no use. How can I install the python in ubuntu server

2

There are 2 best solutions below

1
On

Python 3.6+ should be available by default on Ubuntu 18+, thus find out which Python version is available as listed in package repo files first:

sudo apt search --names-only "^python3\."

See the results and choose 1 of them to install:

sudo apt install python3.6 # Or 3.7 3.8 3.9, etc
5
On

To install python:

sudo apt-get install python3

But Ubuntu already comes with python, so you just use python3. Note that in Ubuntu you always must specify the version 3. To execute a file, run:

python3 file.py

EDIT:

To install python 3.6 specifically, execute:

sudo add-apt-repository ppa:fkrull/deadsnakes 
sudo apt-get update 
sudo apt-get install python3.6