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 directorybut if I use in terminal python2 or python3 it's working perfectly
How to solve this? Please help me
11 Answer
It looks like you don't have symbolic link for python.
- If you want to use python3 when you type python run the following command:
sudo ln -s /usr/bin/python3 /usr/bin/python- If you want to use python2 when you type python run the following command:
sudo ln -s /usr/bin/python2 /usr/bin/pythonIf 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.