"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.
Asked
Active
Viewed 1,162 times
0
-
check this out: https://stackoverflow.com/questions/7743281/cant-set-python-environment-path-variable – Olasimbo May 22 '22 at 14:11
-
Doesn't really help. The problem is that I have python in path, but it is not shown, so I can't remove it and instead put there the folder for python 3.9 to be used. – Milos Potic May 22 '22 at 14:23
-
use `where python` to know the path of python first. Then follow this to remove python https://stackoverflow.com/a/60318668/1836069 – Olasimbo May 22 '22 at 14:25
2 Answers
1
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>'

tax evader
- 2,082
- 1
- 7
- 9
-
1I'm using Windows. And I have found the Environment variable, it was just well hidden under some AppData folders. Thank you for you help – Milos Potic May 22 '22 at 15:23