Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #71708 > unrolled thread
| Started by | CM <cmpython@gmail.com> |
|---|---|
| First post | 2014-05-17 16:53 -0700 |
| Last post | 2014-05-18 12:01 +1000 |
| Articles | 7 — 6 participants |
Back to article view | Back to comp.lang.python
using a new computer and bringing needed libraries to it CM <cmpython@gmail.com> - 2014-05-17 16:53 -0700
Re: using a new computer and bringing needed libraries to it Ned Batchelder <ned@nedbatchelder.com> - 2014-05-17 20:17 -0400
Re: using a new computer and bringing needed libraries to it Rustom Mody <rustompmody@gmail.com> - 2014-05-17 20:29 -0700
Re: using a new computer and bringing needed libraries to it Ben Finney <ben@benfinney.id.au> - 2014-05-18 17:39 +1000
Re: using a new computer and bringing needed libraries to it Terry Reedy <tjreedy@udel.edu> - 2014-05-17 20:29 -0400
Re: using a new computer and bringing needed libraries to it Chris Angelico <rosuav@gmail.com> - 2014-05-18 10:30 +1000
Pip requirements: Machine-readable configuration versus human-audience documentation (was: using a new computer and bringing needed libraries to it) Ben Finney <ben@benfinney.id.au> - 2014-05-18 12:01 +1000
| From | CM <cmpython@gmail.com> |
|---|---|
| Date | 2014-05-17 16:53 -0700 |
| Subject | using a new computer and bringing needed libraries to it |
| Message-ID | <a7f2ad0b-b148-4807-8221-08d42fba72cd@googlegroups.com> |
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.
[toc] | [next] | [standalone]
| From | Ned Batchelder <ned@nedbatchelder.com> |
|---|---|
| Date | 2014-05-17 20:17 -0400 |
| Message-ID | <mailman.10102.1400372406.18130.python-list@python.org> |
| In reply to | #71708 |
On 5/17/14 7:53 PM, CM wrote:
> 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.
--
Ned Batchelder, http://nedbatchelder.com
[toc] | [prev] | [next] | [standalone]
| From | Rustom Mody <rustompmody@gmail.com> |
|---|---|
| Date | 2014-05-17 20:29 -0700 |
| Message-ID | <a52840b3-448d-43ec-94f0-8b53c7b9a619@googlegroups.com> |
| In reply to | #71711 |
On Sunday, May 18, 2014 5:47:05 AM UTC+5:30, Ned Batchelder wrote: > On 5/17/14 7:53 PM, CM wrote: > > > 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. > > 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?
[toc] | [prev] | [next] | [standalone]
| From | Ben Finney <ben@benfinney.id.au> |
|---|---|
| Date | 2014-05-18 17:39 +1000 |
| Message-ID | <mailman.10111.1400398819.18130.python-list@python.org> |
| In reply to | #71719 |
Rustom Mody <rustompmody@gmail.com> writes: > On Sunday, May 18, 2014 5:47:05 AM UTC+5:30, Ned Batchelder wrote: > > Make a list of the [Python-specific] packages you need. Put it in a > > file called requirements.txt. […] > > What about things installed at a lower level than pip, eg apt-get? That's an important issue. Requirements of a project, such as packages that need to be installed from the operating system (e.g. “you need Python 3.2 or later for this project”), are ideal for documenting in plain human-targeted text in a document called “requirements.txt”. Which is why I advocate using a *different* filename, more explicit about its special purpose (e.g. ‘pip_requirements’), for the Pip-specific (and thereby Python-specific) machine-readable configuration file. -- \ “But Marge, what if we chose the wrong religion? Each week we | `\ just make God madder and madder.” —Homer, _The Simpsons_ | _o__) | Ben Finney
[toc] | [prev] | [next] | [standalone]
| From | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| Date | 2014-05-17 20:29 -0400 |
| Message-ID | <mailman.10104.1400372984.18130.python-list@python.org> |
| In reply to | #71708 |
On 5/17/2014 7:53 PM, CM wrote: > 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. -- Terry Jan Reedy
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2014-05-18 10:30 +1000 |
| Message-ID | <mailman.10105.1400373036.18130.python-list@python.org> |
| In reply to | #71708 |
On Sun, May 18, 2014 at 10:17 AM, Ned Batchelder <ned@nedbatchelder.com> 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. +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
[toc] | [prev] | [next] | [standalone]
| From | Ben Finney <ben@benfinney.id.au> |
|---|---|
| Date | 2014-05-18 12:01 +1000 |
| Subject | Pip requirements: Machine-readable configuration versus human-audience documentation (was: using a new computer and bringing needed libraries to it) |
| Message-ID | <mailman.10106.1400378519.18130.python-list@python.org> |
| In reply to | #71708 |
Ned Batchelder <ned@nedbatchelder.com> writes: > 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. Since these requirements are specifically for Python, more specifically for Pip, and even more specifically are supposed to be in a machine-readable foramt and not just an arbitrary free-form text document, can we recommend instead some more specific filename? ‘requirements.txt’ is already used in many projects to document *for a human reader* the project-wide requirements, not jsut for Python, and we should not arrogate a general name like that to a specific tool like Pip. I'd recommend (and have already begun to use) the name ‘pip_requirements’ or the like. I know that there is heaps of Pip-specific documentation out there already recommending the more general name, but I'd like that to change. -- \ “I believe our future depends powerfully on how well we | `\ understand this cosmos, in which we float like a mote of dust | _o__) in the morning sky.” —Carl Sagan, _Cosmos_, 1980 | Ben Finney
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web