0

I downloaded python 3.10 and added to my path. When I run python --version from CMD it gives me the result I want.

C:\CODA\Django-Course\tutorial-env>python --version
Python 3.10.5

However,when i run the command C:\CODA\Django-Course\tutorial-env>python -m venv --upgrade "C:\Users\matts\AppData\Local\Programs\Python\Python310"

I get the following error when i CD into my venv directory:

C:\CODA\Django-Course\tutorial-env\Scripts>python --version
No Python at 'C:\Data\Python\python.exe'

The path is definately correct, not sure what is going on sadly

Brian61354270
  • 8,690
  • 4
  • 21
  • 43
jarjarbinks99
  • 165
  • 1
  • 7
  • you may have to create new `venv` to use different version. – furas Jun 13 '22 at 18:19
  • What does `which python` give you? – smac89 Jun 13 '22 at 18:21
  • @furas - oh really? that seems crazy. So every time I want to upgrade python in a venv, i have to create a new one than migrate my project over to that new environment? – jarjarbinks99 Jun 13 '22 at 18:21
  • @smac89, im using windows and it says that command doesnt exist – jarjarbinks99 Jun 13 '22 at 18:21
  • try `where python` or if you're in powershell `where.exe python` and/or `gcm python` to get the default or `gcm python*` to get all https://stackoverflow.com/questions/304319/is-there-an-equivalent-of-which-on-the-windows-command-line – nigh_anxiety Jun 13 '22 at 18:38
  • @nigh_anxiety nice that worked, unfortunately the path it gives is the one I've been using lol - C:\Users\matts\AppData\Local\Programs\Python\Python310\python.exe - I think furas was correct. anytime I want to upgrade ill just create a new venv, zip up my project than copy/scp it over to the new environment – jarjarbinks99 Jun 13 '22 at 18:46
  • The whole print of `venv` is that you isolate your project from upgrades to other software, such as libraries, but also including Python itself. Suppose your upgrade to Python caused your `venv` project to fail with a syntax error? That isn’t fantasy: it happened between Python 2.5 and 2.6 with variables named `as`. That sort of thing is less likely to happen now, but the principle holds. – BoarGules Jun 13 '22 at 18:53
  • @BoarGules yes that makes sense Boar. Appreciate the response. – jarjarbinks99 Jun 13 '22 at 19:37

0 Answers0