Python Forum
pip installs in a different python version and directory than the default 3.11
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pip installs in a different python version and directory than the default 3.11
#2
(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
Reply


Messages In This Thread
RE: pip installs in a different python version and directory than the default 3.11 - by snippsat - Jun-18-2023, 06:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to find out from outside Python (in Windows) the current version of Python? pstein 5 984 Jun-28-2024, 07:02 AM
Last Post: Samuel34
  run part of a script with a different version of Python jdog 3 714 May-27-2024, 01:57 AM
Last Post: Alice12
  How to resolve version conflicts in Python? taeefnajib 0 1,062 Apr-27-2023, 08:37 PM
Last Post: taeefnajib
  create a default path with idle to a specific directory greybill 0 949 Apr-23-2023, 04:32 AM
Last Post: greybill
  Python venv and PIP version issue JanOlvegg 2 1,476 Feb-22-2023, 02:22 AM
Last Post: JanOlvegg
  Python Version upgrade nitinkukreja 1 1,031 Feb-04-2023, 10:27 PM
Last Post: Larz60+
  Mac default python interpreter Viewpoint8455 2 1,050 Oct-13-2022, 06:25 AM
Last Post: perfringo
  Can't update new python version on Pycharm GOKUUUU 6 4,190 Jul-23-2022, 09:24 PM
Last Post: GOKUUUU
  Building python (3.9.5) with different libexpat version (2.4.6) raghupcr 0 1,429 Feb-25-2022, 11:29 AM
Last Post: raghupcr
  Python keeps running the old version of the code quest 2 4,057 Jan-20-2022, 07:34 AM
Last Post: ThiefOfTime

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020