Celeb Glow
updates | March 20, 2026

Default python path - bash: /usr/local/bin/python2.7: No such file or directory

When I write python on terminal get an error

bash: /usr/local/bin/python2.7: No such file or directory

but if I use in terminal python2 or python3 it's working perfectly

How to solve this? Please help me

1

1 Answer

It looks like you don't have symbolic link for python.

  1. If you want to use python3 when you type python run the following command:
sudo ln -s /usr/bin/python3 /usr/bin/python
  1. If you want to use python2 when you type python run the following command:
sudo ln -s /usr/bin/python2 /usr/bin/python

If you encounter below problem ln: failed to create symbolic link '/usr/bin/python': File exists, try deleting the symbolic link for python using sudo rm /usr/bin/pythonand try above solution.

I hope it helps.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy