I have python2 and python3 on linux

when I tried to setup as for example route53 library usingpip install route53or python -m pip install route53it told me that Requirement already satisfied: route53 in /usr/local/lib/python3.9/dist-packages (1.0.1)

enter image description here

so I want to install route53for python2 not python3.Thank you!

1

Best Answer


Consider creating an alias for python2

Step 1: locate where python2 is located

$ which python2

the output will probably be something like

/usr/bin/python2

Step 2: create an alias for python2

alias python=/usr/bin/python2

Now you can install packages by issuing python like so

$ python -m pip install route53