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


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.

Updated on: 01-Oct-2019

3K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements