0

I've been using the python version 3.6.5 for quite some time now and have installed a whole set of modules with it, and now I'm trying to change into version 3.8.5, because I couldn't get certain vim plugins to work with older versions. The problem is that by changing to this one I have to install all the packages I used before and possibly crash some programs developped along the way. Is there any way to pass the modules installed in the previous version to a new version? Thank you in advance.

Wick Rotate
  • 33
  • 1
  • 1
  • 4
  • The right way is to generate a requirements.txt of all the packages you need, and reinstall them using the new python version. If by "pass the modules" you mean copy-paste, it's not going to work because some modules install differently depending on the Python version. – Gino Mempin Dec 04 '20 at 23:26
  • 1
    Yes it does! Thank you very much for the help! – Wick Rotate Dec 04 '20 at 23:55

1 Answers1

1

What you can do is use pip to get the installed packages from your old install.

freeze will build a requirements list with exact versions installed currently and store them into file install_list.txt

pip freeze > install_list.txt

Then in the new install you can run install with a -requirements file specified to install from.

pip install -r install_list.txt

Best is to start using virtual environments then each application can have its own container and not be concerned about loss of dependencies.

Note that this should at least give you a starting point for installs and might need to have multiple runs as it lists them in alphabetical order. You could edit the install_list.txt to order them by best install order for dependencies or to remote strict versioning (by default it is an == or exact version install)

Tom Myddeltyn
  • 1,227
  • 12
  • 27