0

I want to have the same packages installed on the new version of Python (3.7.4) which I just installed as I do in my old version of Python (3.6.3) such as: Numpy, pandas, opencv, mathplotlib, etc, etc.

Is there an quick & easy way of doing this?

Can I just copy and paste the packages from python36/Lib/site-packages to python37/Lib/site-packages or do I have to use 'pip install' to do it manually for each package?

wuddadid
  • 90
  • 7
  • 2
    Not if you want them to work; obviously it's a pain the reinstall everything, although that's the way you should do it. If you just copied everything you'd likely end up with broken modules everywhere. – l'L'l Aug 24 '19 at 11:06
  • That's what I suspected. Thanks! – wuddadid Aug 24 '19 at 11:29

1 Answers1

0

You can but they will not work. Especially packages such as numpy, pandas, matplotlib, opencv etc. They need to be compiled for a specific target. If you want the exact same packages in 3.7, pip freeze will list all installed packages. Store the output in a file and then use the pip in python 3.7 to install them pip3.7 install -r output_of_pip_freeze.txt

Alexander Ejbekov
  • 5,594
  • 1
  • 26
  • 26
  • Thanks! When I use `pip freeze` on the Python 3.6 packages and install the requirements for these packages on Python 3.7 like you said, will the packages all work with the new version of Python? Will they be installed in their current version or will they be automatically updated to work with 3.7? Is that how you would install the packages or would you do each one manually? – wuddadid Aug 24 '19 at 11:26
  • The `pip freeze` command simply lists the installed packages and their version. As I said, store the output in a file and when you pass them to 3.7, pip will fetch the appropriate wheels and everything from the repositories and install them in 3.7. – Alexander Ejbekov Aug 24 '19 at 12:02
  • Thanks! You've been a great help. – wuddadid Aug 24 '19 at 15:18