My scenario is I have two laptops with fresh installation
of windows
. Now I use both of them for programming.
So, lets suppose I install various python modules/packages in one of the laptop. So is there a way I can clone
this complete python setup on my other laptop. The reason for this is my internet connection currently is very slow so I don't want to download the same module or packages twice and than install them again.
I know I can download the modules in zip file, transfer them on other and than run python setup.py install
but I am going to use pip
to install modules.
Anyways, I was wondering if cloning
of python setup is possible.
zip the contents of C:\python27 to an USB key. copy all python DLLS: copy C:\windows\system32\py*DLL K: (if K is your usb drive) unzip the contents of the archive somewhere on the second machine. add the DLLs directly in the python27 directory.
When a package is installed globally, it's made available to all users that log into the system. Typically, that means Python and all packages will get installed to a directory under /usr/local/bin/ for a Unix-based system, or \Program Files\ for Windows.
PIP is automatically installed with Python 2.7.9+ and Python 3.4+ and it comes with the virtualenv and pyvenv virtual environments.
Here is a completely different suggestion, this is recommended if you want to synchronize the packages between the two PCs and not cloning everything just once.
It only works if you install packages with pip
. It does not work for packages which are not installable/installed with pip.
Freeze your current package environment from the source PC into a requirements file:
$ pip freeze > req.txt
Copy the req file to the target PC and install the packages:
$ pip install -r req.txt
If you put the req.txt
under a VCS you can automate and synchronize this process very smoothly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With