1

I have Python 3.10.9 globally, however version 3.9.15 is still showing up in the virtual environment. How do I upgrade Python in my virtual enviroment?

Previously Anaconda was in the root path, and after many frustrating attempts I finally got rid of conda and miniconda3 in the path. Could this somehow be related to this issue?Terminal Screen Shot

Attempted to upgrade Python via Homebrew - which told me that version 3.10.9 is already installed, it's just not linked. I proceeded through the steps and attempted to link python@3.10 - however this failed, as version 3.9.15 is still showing.Terminal using Homebrew

Ben the Coder
  • 539
  • 2
  • 5
  • 21
MaryK39
  • 29
  • 3
  • Virtual environments are not designed to work that way. Instead, **create a new one** based off the new desired Python version. – Karl Knechtel Jan 14 '23 at 15:37
  • 1
    Does this answer your question? [How do I use different Python version in venv from standard library? (Not virtualenv!)](https://stackoverflow.com/questions/22681824/how-do-i-use-different-python-version-in-venv-from-standard-library-not-virtua) – Karl Knechtel Jan 14 '23 at 15:38
  • Are you using pipenv? – Davin Tryon Jan 14 '23 at 15:43
  • @KarlKnechtel Creating a new one solved the issue, thank you. To be clear, so there is no way to upgrade a python version in an existing virtual environment? – MaryK39 Jan 14 '23 at 15:54
  • 1
    Running `python3 -m venv --upgrade .venv` had no effect when I checked the version – MaryK39 Jan 14 '23 at 15:56
  • 1
    That would be for upgrading the version *of venv*, not of Python. – Karl Knechtel Jan 14 '23 at 15:58

0 Answers0