Open In App

How to Install python-dateutil on MacOS?

Last Updated : 05 Jan, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

The dateutil module provides many options to the standard datetime module, available in Python. Or we can say that it gives extensions to the datetime module. So in this article will learn how to install python-dateutil in Python on macOS.

  • Calculating relative deltas like next month, next year, next Monday, last week of the month, and so on.
  • Based on Olson’s database, it is always internally updated with world timezone information.
  • Calculation of relative differences between two dates and/or DateTime objects.
  • Dates are calculated using a superset of the iCalendar specification and fairly flexible recurrence rules. The parsing of RFC strings is also possible.

Installing python-dateutil on MacOS

Method: Using pip to install python-dateutil Package

Follow the below steps to install the python-dateutil package on MacOS using pip:

Step 1: Install the latest version of Python3 in MacOS

Step 2: Check if pip3 and python3 are correctly installed in your system using the following commands

python3 --version
pip3 --version

Step 3: Upgrade your pip to avoid errors during installation using the following command.

pip3 install --upgrade pip

Step 4: To install python-dateutil using pip3 use the following command

pip3 install python-dateutil

installdateutil

Verifying python-dateutil installation on MacOS

To verify that the python-dateutil module installs properly in macOS use the following import command in your python terminal. If there is any error occurred while importing the module then is not installed properly.

import datetime

verfiydateutil


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads