using a new computer and bringing needed libraries to it


C

CM

If I want to switch my work from one computer to a new one, and I have lotsof various libraries installed on the original computer, what's the best way to switch that all to the new computer? I'm hoping there is some simpleway like just copying the Python/Lib/site-packages folder, but I'm also guessing this isn't sufficient. I was hoping I wouldn't have to just one-by-one install all of those libraries again on the newer computer.

I probably want to develop on BOTH these computers for the time being, too_One is at home and one is at a "remote site"/secret lair. And then I'll be doing it again when I buy a newer computer at some point.

Thanks.
 
Ad

Advertisements

N

Ned Batchelder

If I want to switch my work from one computer to a new one, and I have lots of various libraries installed on the original computer, what's the best way to switch that all to the new computer? I'm hoping there is some simple way like just copying the Python/Lib/site-packages folder, but I'm also guessing this isn't sufficient. I was hoping I wouldn't have to just one-by-one install all of those libraries again on the newer computer.

I probably want to develop on BOTH these computers for the time being, too. One is at home and one is at a "remote site"/secret lair. And then I'll be doing it again when I buy a newer computer at some point.

Thanks.

Make a list of the packages you need. Put it in a file called
requirements.txt. Then install them with:

$ pip install -r requirements.txt

Keep that file up-to-date as you add new requirements.
 
T

Terry Reedy

If I want to switch my work from one computer to a new one, and I
have lots of various libraries installed on the original computer,
what's the best way to switch that all to the new computer? I'm
hoping there is some simple way like just copying the
Python/Lib/site-packages folder, but I'm also guessing this isn't
sufficient.

Have your tried it? Since Python only cares about the contents of
site-packages, copying should be fine, at least as far as python is
concerned. I have copied pythonx.y/Lib/site-packages to
pythonx.(y+1)/Lib/site-packages more than once.

In each site-packages, I also have python.pth containing, in my case,
"F:/Python". packages and modules in F:/Python are imported the same as
if they were in each site-packages. This avoids copying and lets me try
the same file on multiple versions.

Copying does not copy registry entries or anything outside of
site-packages. I do not know whether pip, for instance, does either.
 
C

Chris Angelico

Make a list of the packages you need. Put it in a file called
requirements.txt. Then install them with:

$ pip install -r requirements.txt

Keep that file up-to-date as you add new requirements.

+1. And the "keep up-to-date" bit can be done very well with source
control; that way, you don't need to wonder whether you added one over
here or deleted one over there - the commit history will tell you.

ChrisA
 
Ad

Advertisements

R

Rustom Mody

On 5/17/14 7:53 PM, CM wrote:
Make a list of the packages you need. Put it in a file called
requirements.txt. Then install them with:


$ pip install -r requirements.txt


Keep that file up-to-date as you add new requirements.


What about things installed at a lower level than pip, eg apt-get?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top