I unlink-ed my Python path, what should I do now?

191 views Asked by At

I'm not familiar with Linux and I am just trying to change my Python dir from one to another. I read from another post that if you do:

unlink pathA
ln -s pathA pathB

It will change to pathB. So that's what I did:

unlink /Users/apple/opt/anaconda3/bin/python
ln -s /usr/bin/python /Users/apple/opt/anaconda3/bin/python 

But then when I try to change it back, I did it again, this time unlink-ing the other path:

unlink /usr/bin/python

Now that I know what exactly does unlink do... I realized I did something very bad. This has caused all of my paths being removed. Now whenever I call Python it throws me

python: command not found

And whenever I call pip it throws me

-bash: /Users/apple/opt/anaconda3/bin/pip: /Users/apple/opt/anaconda3/bin/python: bad interpreter: No such file or directory

I know this might be a dumb question but I am just a starter. I really appreciate your help.

1

There are 1 answers

0
Petronella On

You could search where your python installation is with find / -name python 2>/dev/null. This will give you the path to python, the set the python environment variable and there you go. Unless you have something else in mind.
Here you can also find extra info: Add to python path mac os x