Reputation: 5
"python" command in cmd works just fine, which I believe means that python is added to path. I can't find it in PATH in Environment variables tho. The reason Im messing with this is because I want to remove python 3.10 from path to and to add python 3.9.
Upvotes: 0
Views: 2015
Reputation: 4936
PATH
environment variable only store the paths to the directory to find commands or executable files. If you're on Linux or Mac OS, you can find where the python
path is from using the command
which python
which will then reveal the path to the python executable like below example
/usr/bin/python
You can then see where the path is linked to which version of Python using the command ls -l <path to python executable>
> ls -l /usr/bin/python
lrwxr-xr-x /usr/bin/python -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
If you want to link python
command to a specific version of python executable, you can add this line to either .zshrc
(zsh shell) or .bashrc
(bash shell) depending on which shell your terminal is using
alias python='</path/to/python3/executable>'
Upvotes: 1