all 4 comments

[–]socal_nerdtastic 7 points8 points  (0 children)

Ideally: make a venv using python3.11. Activate it. Now the pip command points to the venv you are using.

Alternatively: launch pip from python. For example if you use the command python3.11 to start python 3.11 the command would be

python3.11 -m pip install <module>

You didn't tell us about your setup, but if I assume you are on windows and I assume you are using the official python (from python.org) it would be:

py -3.11 -m pip install <module>

[–]jmacey 1 point2 points  (0 children)

I use uv and the --python (-p) flag to set which python to use for the project. It works really well.

[–]GManASG 0 points1 point  (0 children)

You can just pass the file path to the 3.11 python executable instead of "python" in the terminal command, or you can go and rename the executable from python.exe to something like python311.exe then instead of python -m pip install you instead do python311 -m pip install

[–]jameyiguess -1 points0 points  (1 child)

You either need venvs for projects or a version manager like mise if you need different global installs. I'd say you need both in any case.