pythonpython-3.xpippackagesite-packages

Can I copy and paste software packages from my old Python 3.6.3 to the /Lib/site-packages directory of a newly installed Python 3.7.4?


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?


Solution

  • 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