'python 2.7 dateutil install in Ubuntu 21.04

My Ubuntu 21.04 came with preinstalled with python 3.

I installed python 2.7 in parallel since all my programs are in python 2.7.

In my modules, import dateutil is used.

Since the system default is python 3, how do I install python-dateutil in python 2.7?

Thanks.



Solution 1:[1]

FTR, these steps were necessary:

  1. Install pip in Python 2.7. This answer in another SO question worked for OP.

  2. Install dateutil using the corresponding pip version:

    sudo python2.7 -m pip install python-dateutil
    

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Brian Burns