Linux mint and python

How to Install Latest Python on Linux Mint 21

Python is a user-friendly high-level and object-oriented programming language that can be easily interpreted. This general-purpose language is famous among users for simple coding projects to complex scripts including Artificial Intelligence and machine learning scripts. It has easily understandable syntax for coding even for the beginners.

Although it is easy to understand, it can perform complex algorithms and can handle huge amounts of data. Python language was designed in a way that it can be extended by adding more modules to the existing ones.

How to Install Latest Python on Linux Mint 21

The latest version of Python can be installed via an external PPA repository. For this, few steps should be followed carefully:

Open the terminal and update apt packages using command:

Execute the mentioned command to install prerequisite dependencies of Python:

Next step it to add PPA repository to the Linux Mint base repository (as it is external repository, so we need to add it first):

As all the dependencies and external repository are installed on Linux Mint 21. Now we can download Python on system by running the following command:

Use the version command to verify if python is installed or not:

How to Uninstall Python from Linux Mint 21

To remove Python from Linux Mint 21 system, the following would be use:

As we have added a PPA repository to the system before downloading Python. So, you can also remove it from system:

Conclusion

This article has focused on how to install an updated version of Python on Linux Mint 21. Python is a highly recommended interpreted language used for various purposes. It can create small projects to large scripts like machine learning and AI with understandable syntax. It was designed in a way that it can be extended by adding more modules to the existing ones.

About the author

Syeda Wardah Batool

I am a Software Engineer Graduate and Self Motivated Linux writer. I also love to read latest Linux books. Moreover, in my free time, i love to read books on Personal development.

Источник

How to install Python in Ubuntu and Linux Mint

install python in ubuntu

P ython is one of the most popular programming languages used for developing many kinds of software. Python is a popular choice for both beginners and expert programmers. Due to its easy-to-learn syntax and powerful libraries, it is loved and adopted by millions of programmers all over the world.

Python can do any task, including Web Development, Data Science, Artificial Intelligence, Automation, or any other General Programming task. Python can be used to build applications for any platform, including Linux, Windows, or Mac. Now Python has also supported building Android applications due to the Kivy library. In today’s article, we will see how to install Python on Linux.

The most significant advantage of Python is its strong support for integration with other languages and tools. People also love the simplicity in which it can be learned in a few days compared to other languages, which takes more time to be learned. Python has many different libraries; we can store data in Python using the SQLite databases in Python, which is a great way to store our application data in Python.

This tutorial will help you set up and install the latest version of Python on Ubuntu and its derivatives, including Linux Mint and elementary OS. If you love Linux, you may also look at the article using Linux shell commands in Python.

Installing Python on Ubuntu and Linux Mint

This tutorial is done on Ubuntu 16.04. It should work on all Ubuntu derivatives, including Linux Mint, Pop!_OS, elementary OS, and more.

Ubuntu, Linux Mint, and many other Linux OS come pre-installed with some version of Python. The only thing you need to verify is if it’s the latest version. To check the current version installed on your computer, launch ‘Terminal’ and type the following command:

You should see a lot of output in the terminal but pay attention to the Python version_number, followed by the date.

Python 3.5.2 (default, Nov 17 2016, 17:05:23)

But as of when this article was written, the Python version available on the official website is Version 3.6.0. It’s always a good idea to have the latest version to get full features.

The easiest way of installing Python in Ubuntu and its derivatives is by using the apt-get command. Of course, there is also a long way to download and install it manually. We shall discuss both methods here.

METHOD 1: Using the apt-get command

STEP 2: Copy and paste the following command and hit enter to add J Fernyhough’s PPA.

sudo add-apt-repository ppa:jonathonf/python-3.6

STEP 3: Update the sources.

STEP 4: Finally, install Python 3.6 using the apt-get command. It will download the installer package and install it. You will have to enter the root password when prompted.

sudo apt-get install python3.6

METHOD 2: Compile from Source Code

If you wish not to add any more PPAs to your computer, you can download the Python source code and compile it.

STEP 1: Before installing Python, it is recommended to install some dependencies. To do that, launch Terminal and copy-paste the following commands in the terminal, and hit enter.

sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

STEP 2: Go to Download Python’s official webpage and download the latest version of Python. You can download the Gzipped source tarball.

STEP 3: Launch Terminal and navigate to the ‘Downloads’ folder or wherever you downloaded the Python .tgz package. Make sure to use the exact file name to extract after -xvf in the below command.

STEP 4: Now navigate into the extracted directory.

STEP 5: You can now compile the source code. Enter the following command one by one.

Python should now be installed on your computer successfully. After installing Python, you may use one of the best python IDE so you can write code quickly and fast..

Conclusion

This tutorial explains everything about how to install and update Python on a Linux system. You may also want to see our step-by-step guide on installing anaconda in Python. Installing anaconda will let you efficiently manage python packages and maintain a different Python version by creating virtual environments.

Источник

Читайте также:  Html and xml data
Оцените статью