How we can copy Python modules from one system to another?

PythonServer Side ProgrammingProgramming

If you have your own Python modules you want to copy, you can simply copy them and run on other systems with Python installed. If you want to copy installed modules, the best way is to install the same version of Python on the second system. Then run

$ pip freeze > installed_modules.txt

on the first system to get a list of the installed modules in the installed_modules.txt file. Now copy this file over to second system. Now use pip to install these modules using:

$ pip install -r installed_modules.txt

This will install all modules that were installed on the first system. It is the best way as simply copy pasting from one system to the other can cause problems due to differences in OS, Architecture, versions, etc.

raja
Published on 21-Dec-2017 06:59:43
Advertisements