1

enter image description here I installed the python3.8 version for my application and deleted the python2.7 in amazon linux 2 , now yum command is not working.

3
  • reinstall Python 2.7. Multiple Python version can co-exist. for your application, learn how to use "venv" Commented Jun 28, 2021 at 8:17
  • Welcome to the site. Please don't post screenshots of console output. They are often difficult to read, the content will not show up in search engine results, and contributors trying to help will have to type-copy content when trying to analyze/reproduce your problem. Instead, paste it into the question using code formatting. Commented Jun 28, 2021 at 10:09
  • Do you have "dnf" installed? It may not work for the same reason "yum" won't work - or it might not exist Amazon LInux 2. In fact you may have a hard time anything. I'd recommend contacting AWS to see if they can re-install it for you. Commented Jun 28, 2021 at 20:31

1 Answer 1

0

Could be you have not deleted the actual file and have just deleted the link the /usr/bin/python

Assuming that is the case

Check what all python are present in the directory by ls /usr/bin/python*

If python 2.7 is present then create a symlink for the same by

Backup usr/bin/python first

You can create symlink by

sudo rm /usr/bin/python
sudo ln -s /usr/bin/python2.7 /usr/bin/python

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.