Open In App

How to Install python-YAML package on Linux?

Improve
Improve
Like Article
Like
Save
Share
Report

PyYAML is a special Python library for the package that is often used for the configuration of files and also can be used for data exchange purposes. PyYAML package is a Python YAML parser that permits the user to write YAML data and also parse it. PyYAML library is quite similar to the JSON library in Python which allows the user to work with JSON formatted data. So, In this article, we will be installing the PyYAML Python library on Linux System.

Installing the PyYAML package on Linux using PIP

Requirements:

  1.    Python3
  2.    Python3-pip

To install the PyYAML package in Linux follow the following steps:

Step 1: Firstly, we will install the current version of Python3 using the following command.

sudo apt-get install python3

Installing-latest-version-of-python3

 

Step 2: Now, we will install the pip package manager, which is responsible for installing the external packages. Use the below command to install the pip manager

sudo apt install python3-pip

Installing-the-pip-package-manager

 

Step 3: Now using the PIP manager we are going to install the PyYAML package. So for the installation run the following command on the terminal.

sudo pip3 install PyYAML 

Installing-the-PyYAML-package

 

Verifying the installation of the PyYAML package 

After installing the package, the next important step is to check the installation of the PyYAML package is successful or not. So here, we are simply getting the information of the installed package (PyYAML) by executing the below command on the terminal itself.

python3 -m pip show PyYAML 

The below output will be displayed after the successful installation of the PyYAML package on your Linux machine.

Verifying-the-installation-of-the-PyYAML-package

 


Last Updated : 25 Apr, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads