How to Install PyYAML on MacOS?
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.
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.
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.
Contact Us