Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #51709

Re: Using system python vs. updated/current version

From alex23 <wuwei23@gmail.com>
Newsgroups comp.lang.python
Subject Re: Using system python vs. updated/current version
Date 2013-08-01 10:44 +1000
Organization A noiseless patient Spider
Message-ID <ktcakv$fil$1@dont-email.me> (permalink)
References <mailman.48.1375295768.1251.python-list@python.org>

Show all headers | View raw


On 1/08/2013 4:35 AM, memilanuk wrote:
> Also... in some places in the 'Net I see references to installing
> everything 'locally' via pip, etc. in virtualenvs and not touching the
> system installed version of python... yet most linux distros seem to
> have many/most such packages available in their package repos, which
> seems like it'd be easier to install via the package manager and let it
> keep things updated.  Could someone touch on what they feel the pros and
> cons would be either way?

Generally, if your OS installs a version of Python by default you should 
leave it alone because the OS itself is dependent on it. Updating to 
newer versions of Python or installed libraries can introduce version 
conflict errors in system-level apps, which is a bad thing.

Similarly, using the system install & libraries ties you to those 
versions. This may not be an issue if you're just scripting a few helper 
tools for your system, but it's an unnecessary hinderance if you're 
developing independent applications.

Tools like virtualenv or zc.buildout provide a handy way of sandboxing 
the dependencies of individual applications. They let you build more 
than one app in parallel and not let the dependencies of one interfere 
with the others. Of equal importance is their use in deploying to other 
machines. With virtualenv, you can create a list of installed libraries 
with:

     pip freeze > requirements.txt

To ensure a target machine has all of the dependencies your application 
needs you can then do:

     pin install -r requirements.txt

So: for simple scripts, just go with the system install. For serious 
development work, I highly recommend using virtualenv or zc.buildout to 
contain each development environment.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Using system python vs. updated/current version memilanuk <memilanuk@gmail.com> - 2013-07-31 11:35 -0700
  Re: Using system python vs. updated/current version alex23 <wuwei23@gmail.com> - 2013-08-01 10:44 +1000

csiph-web