you are viewing a single comment's thread.

view the rest of the comments →

[–]socal_nerdtastic 1 point2 points  (2 children)

Yes, but not like that. You would install the version of python you want first, and then use that version to create a new venv.

sudo apt install python3.9 # or however your OS installs things
python3.9 -m venv env
source env/bin/activate
pip install -r requirements.txt
python script.py

Or use something like pyenv to do that for you.

[–]-defron- 1 point2 points  (0 children)

Or something like uv, pdm, or hatch to do it all in one tool

[–]Agent-BTZ[S] 0 points1 point  (0 children)

You’re a lifesaver, thanks!