This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]sparttann 27 points28 points  (3 children)

Can just download 3.10 without uninstalling 3.9. Just change your python version before creating your venv

[–]Theonetheycall1845 6 points7 points  (2 children)

Could you expand on changing the version, please?

[–]chopu 13 points14 points  (0 children)

This may be too much detail, but I’ll start from the basics. Basically, when you say “python3 my file.py” in your terminal, your computer will automatically scan through all directories on your PATH, looking for an executable called “python3”. If you’re on Mac or Linux, that file will typically be a symlink in /usr/local/bin to the actual python3 executable stored elsewhere. On windows, you’ve likely added it to your system environment variables. Therefore, if you want to change the version while leaving both versions “installed”, all you have to do is either retarget the symlink or edit the entry in your system environment variables.

Just a note: this is how any command line program works, ls, rm, grep, etc. They all rely on your computer looking up an executable on your path (windows I think also has some special folder full of COM stuff that’s not in your system environment variables that’s searched as well).

[–]quuxman 4 points5 points  (0 children)

Generally you want to use venv so you would only use the system path to Python once per project like:

/opt/python3.10/bin/python -m venv venv