#πŸ”’ Installation of Python 3.12.10?!

43 messages Β· Page 1 of 1 (latest)

lyric meadow
#

How would I set up this version of Python, so that it doesn't overwrite the environment settings for Python 3.13.4? πŸ€”

golden wingBOT
#

@lyric meadow

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

torn nest
#

Customize Installation

lost widget
#

Do not check "Add python.exe to PATH"

lyric meadow
lost widget
#

Click "Customize installation" instead of "Install Now"
During customization:
Set the install path to something unique like
C:\Python312\

This avoids overwriting anything from 3.13.4.

torn nest
#

^ generally, though, each version of Python installs in its own directory, but the default options as shown there look fine.

#

You'd then use py -3.12 to invoke Python 3.12 from the command line

#

so to create a venv for a project, you'd use py -3.12 -m venv .venv

#

(don't do this on top of an existing venv directory, though!)

#

(you could say .venv312 to be unambiguous)

lyric meadow
#

How does that look like?

torn nest
#

that should be fine.

lyric meadow
torn nest
#

and really, that's the recommended way to access multiple versions of Python now

lyric meadow
#

Okay, I clicked on Install

#

There was some kind of PowerShell command that shows all installed Python versions? Do you know that?

torn nest
#

py -0p

#

that also lists the paths to each, which is useful

lyric meadow
#

What does that ***** stand for? Is it the main one? πŸ€”

torn nest
#

That indicates which is the default when you run py

#

you can change that with an environment variable.

lyric meadow
torn nest
lyric meadow
torn nest
#

you'd set PY_PYTHON to the version you want to use, then restart any open shells

#

e.g., in PowerShell: $Env:PY_PYTHON=3.12

lyric meadow
torn nest
#

you'd type that command in PowerShell.

lyric meadow
torn nest
#

it indicates Env:PY_PYTHON is a variable of some kind

lyric meadow
torn nest
#

It's a general skill

lyric meadow
torn nest
#

I never formally learned it; I just picked up what bits I needed to get by along the way, because I don't really do a lot of stuff in the shell that demands full-blown scripting

lyric meadow
#

Okay, I see. Thanks for helping out! πŸ™

#

!close

golden wingBOT
#
Python help channel closed with !close

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.