Python Forum
Installation of packages to newest Python version from previous one
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Installation of packages to newest Python version from previous one
#1
Hi,
Is it possible to check what python packages are installed let's say into my present 3.10.3 version
and get that list and somehow install it to 3.11 version all together ?
That would be good solution instead installing them one by one.
Reply
#2
(Jul-15-2023, 07:21 AM)Andrzej_Andrzej Wrote: Is it possible to check what python packages are installed let's say into my present 3.10.3 version
and get that list and somehow install it to 3.11 version all together
Yes there is but i would not requirement it all for main Python version more for virtual environment.
Talking about to use of pip list and pip freeze to a requirements.txt.
By your previous post you use Windows,if Python 3.11 is in you OS Path for Windows use this to list what install to 3.10.
# list all installed to 3.10
py -3.10 -m pip list 

# 3.11 if that in OS path
pip list

# Or
py -m pip list
If freeze to requirements.txt that can install that 3.11,but would not recommend this at all.
See that it freeze to version when was installed,and don't consider newer versions.
py -3.10 -m pip freeze > requirements.txt
# Install to 3.11,but no no
pip install -r requirements.txt

So what to do?
Just install manually can use pip list as refences,or something like pip-chill.
Learn to use virtual environment if have a project that have many dependencies.
Eg install 3 or more packages would be like this,here in virtual environment.
(new_env) G:\div_code\new_env
λ pip install requests pip-chill click
.....
Successfully installed click-8.1.5 requests-2.31.0 colorama-0.4.6 pip-chill-1.0.3
# Or if put same packages a req.txt,and use this file to install
pip install -r req.txt
Requirement already satisfied: requests in g:\div_code\new_env\lib\site-packages (from -r req.txt (line 1)) (2.31.0)
.....
Reply
#3
Thank you,

What kind of command can give me detailed info about all python installations in my windows, by detailed I mean that if I have got 3.10.4, it will display it like that, not short version like 3.10 ?
And I want to know where all those versions are installed ? I am googling but not found such a code like in one-liner piece.
Reply
#4
(Jul-15-2023, 11:00 AM)Andrzej_Andrzej Wrote: by detailed I mean that if I have got 3.10.4, it will display it like that, not short version like 3.10 ?
Usually do not have two separate 3.10 versions,as just upgrade is the normally way to do in Windows.
So if upgrade to newest eg Python 3.10.12,that is the only one of 3.10 should have.
Use py to list versions.
py --list

# As py is cli tool is has help
py --help
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  run part of a script with a different version of Python jdog 2 460 Jan-09-2024, 08:49 PM
Last Post: jdog
  How to find out from outside Python (in Windows) the current version of Python? pstein 4 752 Oct-04-2023, 10:01 AM
Last Post: snippsat
  Python installation for old MacOS Yonix 1 499 Sep-21-2023, 03:32 PM
Last Post: menator01
  Installing python packages in a virtual environment Led_Zeppelin 1 775 Aug-15-2023, 08:18 PM
Last Post: deanhystad
  How to resolve version conflicts in Python? taeefnajib 0 933 Apr-27-2023, 08:37 PM
Last Post: taeefnajib
  How to see the date of installation of python modules. newbieAuggie2019 4 1,640 Mar-31-2023, 12:40 PM
Last Post: newbieAuggie2019
  Getting "SSL client not supported by this Python installation" error prabirsarkar 0 966 Mar-13-2023, 05:01 PM
Last Post: prabirsarkar
  Python venv and PIP version issue JanOlvegg 2 1,279 Feb-22-2023, 02:22 AM
Last Post: JanOlvegg
  Python Version upgrade nitinkukreja 1 913 Feb-04-2023, 10:27 PM
Last Post: Larz60+
  python installation/running inside singularity container erdemath 2 1,809 Sep-21-2022, 08:13 AM
Last Post: erdemath

Forum Jump:

User Panel Messages

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