2

I have been using python 3.8 for quite some time , but now I want to use python 3.9. The problem is that I have a lot of packages installed in the 3.8 folder. Is it possible to "move" all these packages to the 3.9 folder? Or can anyone suggest me a better way to deal with this issue?

su2187
  • 173
  • 1
  • 1
  • 9
  • 1
    I would suggest reinstalling each module, due to potential compatibility issues. – DapperDuck Dec 29 '20 at 17:36
  • See also https://pip.pypa.io/en/stable/reference/pip_freeze/ though I'd watch out for compatibility issues as pointed out by @DapperDuck –  Dec 29 '20 at 17:37
  • Ideally, you should be using a virtual environment and have your libraries defined in a `requirements.txt`, `Pipfile`, `project.toml`, or similar. Then you could create a new virtual environment using Python 3.9 and reinstall everything easily. – ChrisGPT was on strike Dec 29 '20 at 17:38
  • 2
    Does this answer your question? [How to install python packages from older version to newer version?](https://stackoverflow.com/questions/58473864/how-to-install-python-packages-from-older-version-to-newer-version) – Tom Myddeltyn Dec 29 '20 at 17:44

1 Answers1

1

You can make a requirements .txt file by: pip freeze > requirements.txt

and after installing python 3.9 type(in the same directory in which you made the requirements.txt): pip install -r my_packages.txt

As shown in this post

SVG
  • 33
  • 8