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


Groups > comp.lang.python > #24832

Re: Why site-packages?

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'importing': 0.04; 'processed': 0.05; 'startup': 0.05; 'frontend': 0.07; 'skip:/ 10': 0.07; 'python': 0.09; 'app,': 0.09; 'imported': 0.09; 'module)': 0.09; 'subject:Why': 0.09; 'cc:addr:python-list': 0.10; 'thread': 0.11; 'suggest': 0.11; 'cc:name:python list': 0.16; 'libraries?': 0.16; 'thread.': 0.16; 'uses,': 0.16; 'wrote:': 0.17; 'basically': 0.17; 'certainly': 0.17; 'saying': 0.18; 'requests': 0.18; 'module': 0.19; 'import': 0.21; 'option.': 0.22; 'cc:2**0': 0.23; 'for?': 0.23; "python's": 0.23; 'third-party': 0.23; 'installed': 0.23; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'actual': 0.28; 'environment': 0.29; 'dan': 0.29; 'starts': 0.29; 'ends': 0.30; 'stuff': 0.30; 'code': 0.31; 'gets': 0.32; 'asking': 0.32; 'could': 0.32; 'another': 0.33; 'that,': 0.34; 'version': 0.34; 'received:google.com': 0.34; 'clear': 0.35; 'adds': 0.35; 'built- in': 0.35; 'same.': 0.35; 'pm,': 0.35; 'subject:?': 0.35; 'received:209.85': 0.35; 'but': 0.36; '(i.e.': 0.36; 'modules': 0.36; 'should': 0.36; 'option': 0.37; 'two': 0.37; 'why': 0.37; 'virtual': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'things': 0.38; 'nothing': 0.38; 'little': 0.39; 'application': 0.40; 'subject:-': 0.40; 'header:Received:5': 0.40; 'think': 0.40; 'your': 0.60; 'making': 0.64; 'jul': 0.65; 'today': 0.67; 'application?': 0.84; 'cuts': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=4NO/vRA5a7DHjmbi8CaVzFPIZlj6+Oag9ovLxsmMj3s=; b=Ru2ffOd3m+DK1WFA1cZMjiuP6OSEjv34UMVoLYorQoctZNP7rxcKioVdNyAlqe6OiQ iIibPpjAMSFwjLyox/eTLMyJGqG/vAAq+kOV0kfPsqta2x1ZhXXCB1wkWq6EPyRsChgq w16d4KRMxoQhRFen/3aYm7B0jVUg6awkRRM5qU/MC8GnmzTwZnmkLkSzH27fcIq45Isx MGY0tO+JDD+d+ksO+j/Ba4Y9AI8JC9svJgL8LRiC7QH6X4LSq5aglALbnSKTj8mLafmT N9NSxepEF2x8VKDh5E1XtNS91a6qWvP9eSfQEH9pcURoeYxZ3cgdx9ze6GqVA1ga7RL7 uCmg==
MIME-Version 1.0
In-Reply-To <CAGGBd_przF6HtPz5EQ=D8PssmQSda79n=ZwkZKoeQDaz4Dpg8w@mail.gmail.com>
References <CAGGBd_przF6HtPz5EQ=D8PssmQSda79n=ZwkZKoeQDaz4Dpg8w@mail.gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Tue, 3 Jul 2012 15:04:17 -0600
Subject Re: Why site-packages?
To Dan Stromberg <drsalists@gmail.com>
Content-Type text/plain; charset=ISO-8859-1
Cc Python List <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1758.1341349496.4697.python-list@python.org> (permalink)
Lines 42
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1341349496 news.xs4all.nl 6872 [2001:888:2000:d::a6]:46567
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:24832

Show key headers only | View raw


On Tue, Jul 3, 2012 at 2:40 PM, Dan Stromberg <drsalists@gmail.com> wrote:
>
> Why is it that so much 3rd party python code gets installed to
> site-packages?

Because that's what site-packages is for?

> Even for things that are almost certainly going to be used by a single
> application?
>
> Even for things you might only use once?
>
> Even for things that might require one version for one app, and another
> version for another app?

For these types of uses, I suggest using virtualenv if you don't want
to pollute your site-packages.  Or Python 3.3 with the new built-in
virtual environment option.

> Why not stash an application's python modules in /usr/local/lib/[appname],
> and stash a little frontend in /usr/local/bin that adds
> /usr/local/lib/[appname] to sys.path?

What if you then write an application that you find needs two of these
libraries?  You write yet another frontend that adds both of them to
sys.path?

> Here's a thread on stackoverflow today asking why python starts up so
> slowly, and making it clear that this is because so much stuff ends up in
> site-packages:
> http://stackoverflow.com/questions/11318028/is-it-safe-to-use-pythons-s-option

I think you may be misunderstanding that thread.  They're saying that
starting Python with the -S option (i.e. not automatically importing
the site module) significantly cuts down on Python's startup time.
The site module has to process any .pth files in the site-packages,
but apart from that, I think the actual amount of stuff in
site-packages should be irrelevant.  Nothing in site-packages is
actually imported or otherwise processed until the application
requests it.  You could have a completely empty site-packages, or you
could have 20 gigs of third-party packages, and the time to import
site would be basically the same.

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


Thread

Re: Why site-packages? Ian Kelly <ian.g.kelly@gmail.com> - 2012-07-03 15:04 -0600

csiph-web