(Jun-18-2023, 05:19 PM)ao_tex_mal Wrote: So first question is - why is that happening and how do I change that behavior? I want pip to install packages to 311 directory by default without having to specify the target every time. I thought the PATH variable being defined and set int he right order should achieve that.No,if you want to use Python 3.11 as default you delete all other paths in Environment Variables(System Variables).
Then use can
py
to acesss older versions,it will find most that installed. G:\div_code λ py --list -V:3.11 * Python 3.11 (64-bit) -V:3.10 Python 3.10 (64-bit) -V:3.9 Python 3.9 (64-bit) -V:3.8 Python 3.8 (64-bit) -V:3.7-32 Python 3.7 (32-bit) -V:3.6-32 Python 3.6 (32-bit) -V:3.5-32 -V:3.4 -V:2.7 -V:2.1 -V:ContinuumAnalytics/Anaconda39-64 Anaconda py39_4.9.2 -V:ContinuumAnalytics/Anaconda37-64 Anaconda 4.7.12 -V:ContinuumAnalytics/Anaconda36-32 Anaconda 4.3.14 # If i want use Python 3.9 it would be like this G:\div_code λ py -3.9 hello.py hello world # Install a package to eg 3.6 G:\div_code λ py -3.6 -m pip install requests # I have set Python 3.11 in Path G:\div_code λ python -V Python 3.11.3 G:\div_code λ pip -V pip 23.1.2 from C:\python311\Lib\site-packages\pip (python 3.11) # py alone always use lastet version G:\div_code λ py -V Python 3.11.3