python 2.7 dateutil install in Ubuntu 21.04

791 Views Asked by At

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.

1

There are 1 best solutions below

0
On BEST ANSWER

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