-1

I recently upgraded to python 3.11 and i noticed that, since its just a new install of python, i dont get all the packages indecently installed. How do i manage to install all old packages on the new python version?

notRelevant
  • 43
  • 2
  • 7
  • 5
    The same way you installed them for 3.10. Package installation is not terribly expensive, either in time or disk space, so you should generally run your code in a project-specific virtual environment that gets freshly provisioned upon creation. – chepner Dec 15 '22 at 15:25
  • 2
    Assuming this is for a specific project (otherwise why do you need third-party packages?), have you declared your dependencies? Normally you'd create a new virtual environment with the new version and then re-install your dependencies. – ChrisGPT was on strike Dec 15 '22 at 15:32
  • 1
    freeze them and reinstall – Andreas Dec 15 '22 at 15:42
  • @chepner the reason why i ask is because i collect my modules overtime. I don't have a project with ALL the dependencies that i need for every future project. And because i often work offline i dont want to end up with needing a module i once needed but i currently dont have anymore because of the old version of python. Until now i didnt know about `freeze` so that makes it easier – notRelevant Dec 16 '22 at 08:32
  • This might be of interest: https://stackoverflow.com/q/38469340/1126841 – chepner Dec 16 '22 at 13:11

1 Answers1

1
  1. Generate a list of your installed packages
pip freeze > packages.txt
  1. Update Python
  2. Install your packages from the file
pip install -r packages.txt
flexagoon
  • 170
  • 8