Search code examples
pythonpython-2.7python-dateutilubuntu-21.04

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

  • 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