Open In App

How to Install PyYAML on MacOS?

Last Updated : 18 Oct, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

YAML is a data serialization format that allows interaction with scripts. It is often used to create configuration files as it prioritizes human readability over JSON. PyYAML is a tool for parsing and outputting YAML for Python. It has many useful features, such as an API for low-level event-based parsing and sending, and full Unicode support. It supports YAML tags and some Python-specific tags that can be used to represent any Python object. This article will show you how to install PyYAML on macOS.

Pre Requisites

Below are some recommended things that you should have for installing the PyYAML module on macOS are:

  • Python
  • PIP or Conda (Depending upon user preference)

Installing PyYAML on MacOS

Installation Using PIP

Users who prefer pip can install the PyYAML module on macOS using the following command in the terminal:

pip install PyYAML

You will get a similar message once the installation is complete.

Installing-pyyaml-on-macos

 

Installation Using Conda

Same as above, Users who prefer conda can install the PyYAML module on macOS using the following command in the terminal:

conda install PyYAML

Enter y when prompted for yes. Once the installation is complete, You will get a similar message.

Installing-pyyaml-on-macos-using-conda

 

Verifying PyYAML Module Installation

To verify that PyYAML has been successfully installed on your system, run the following code in the Python IDE of your choice:

Python3




import yaml
yaml.__version__


If successfully installed you will get the following output.

Verifying-pyyaml-module

 


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads