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


Groups > comp.lang.python > #3310

Re: PYTHONPATH

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <akabaila@pcug.org.au>
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; 'python,': 0.01; 'python.': 0.05; 'accessible': 0.05; '(of': 0.07; 'mess': 0.07; 'received:localnet': 0.07; 'python': 0.07; '(there': 0.09; 'bash': 0.09; 'executed': 0.09; 'invocation': 0.09; 'modulo': 0.09; 'skip:\\ 10': 0.09; 'wxpython': 0.09; 'gui': 0.14; 'wrote:': 0.14; '"real"': 0.16; '*nix': 0.16; 'discarded': 0.16; 'idle,': 0.16; 'libs.': 0.16; 'numpy': 0.16; 'offense': 0.16; 'shell"': 0.16; 'variable.': 0.16; '"python': 0.16; 'versions': 0.18; 'shell': 0.19; 'cc:2**0': 0.20; 'code,': 0.20; 'variable': 0.21; 'header :In-Reply-To:1': 0.22; 'primarily': 0.22; '(on': 0.23; 'directory.': 0.23; 'platforms,': 0.23; 'version.': 0.23; 'version': 0.25; 'windows': 0.26; 'environment': 0.26; "i'm": 0.26; 'changed': 0.27; 'thanks': 0.29; 'problem': 0.29; 'changes': 0.29; 'yet': 0.30; 'this.': 0.30; 'cc:addr:gmail.com': 0.31; 'al.': 0.31; 'os,': 0.31; 'porting': 0.31; 'state,': 0.31; 'does': 0.31; 'separate': 0.31; 'all,': 0.31; 'to:addr:python-list': 0.32; 'another': 0.32; 'idea': 0.32; 'things': 0.33; 'test': 0.33; 'using': 0.34; 'belong': 0.35; 'header:User-Agent:1': 0.35; 'usually': 0.36; 'running': 0.36; 'received:au': 0.36; 'platform': 0.36; 'program,': 0.36; 'shows': 0.36; 'setting': 0.36; 'some': 0.37; 'should': 0.37; 'useful': 0.37; '2.5': 0.38; 'ways': 0.38; 'user': 0.38; 'but': 0.38; 'url:org': 0.38; 'here,': 0.39; 'url:au': 0.39; 'set': 0.39; 'to:addr:python.org': 0.39; 'whatever': 0.39; 'works': 0.40; 'opened': 0.60; 'header:Message- Id:1': 0.62; '2011': 0.62; 'lives': 0.64; 'interest': 0.65; 'special': 0.66; 'home': 0.67; 'here.': 0.68; 'isolated': 0.84; 'vista,': 0.84; 'xp,': 0.84
From Algis Kabaila <akabaila@pcug.org.au>
Organization PCUG - Users Helping Users
To python-list@python.org
Subject Re: PYTHONPATH
Date Sat, 16 Apr 2011 20:57:51 +1000
User-Agent KMail/1.13.5 (Linux/2.6.35-25-generic-pae; KDE/4.5.1; i686; ; )
References <mailman.387.1302856392.9059.python-list@python.org> <%K8qp.22913$J36.20343@newsfe08.iad> <a450fed2-825c-4626-ac26-ededb389c6f6@q40g2000prh.googlegroups.com>
In-Reply-To <a450fed2-825c-4626-ac26-ededb389c6f6@q40g2000prh.googlegroups.com>
MIME-Version 1.0
Content-Type Text/Plain; charset="iso-8859-1"
Content-Transfer-Encoding 7bit
Cc jmfauth <wxjmfauth@gmail.com>
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.419.1302951469.9059.python-list@python.org> (permalink)
Lines 60
NNTP-Posting-Host 82.94.164.166
X-Trace 1302951469 news.xs4all.nl 81476 [::ffff:82.94.164.166]:50722
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:3310

Show key headers only | View raw


On Saturday 16 April 2011 20:03:22 jmfauth wrote:
> On 16 avr, 06:16, harrismh777 <harrismh...@charter.net> wrote:
> > By default the sys.path always shows the directory python
> > was opened in, usually the users home directory. With
> >  .profile  you can set the path any way you want... most
> > useful for setting up special test directories ahead of
> > the "real" code, or for setting up separate directories
> > for versions--- one for Python26, Python27, and of course
> > Python32.
> > 
> > (there are other ways of accomplishing the same thing, and
> > of course, this one only really works with *nix systems---
> > windows is another mess entirely)
> 
> I belong to those who are very happy with the Python
> installations on Windows platform (thanks MvL, this should
> be said) and I hope it will continue like this.
> 
> I do not see any mess here. Every Python version lives in
> its own isolated directory, including \site-packages.
> That means I can keep, eg, a Python 2.5 application (*) which
> is using PIL, wxPython and numpy in a running state, while
> developping new applications with other Python versions or
> porting that application (*) to another Python version. And
> that on all Windows versions (Win2K, XP, Vista, Win7) modulo
> the underlaying os-libs compatibility, but that's the same
> problem on all os, especially for the GUI libs.
> 
> I'm using Python since ver 1.5.6 and I never set any
> PYTHONPATH environment variable.
> 
> A final word about sys.path. This is is my mind the
> most clever idea of Python. I have the feeling, no
> offense here, you are not understanding it very well.
> The sys.path is some kind of *dynamic* environment
> variable and has basically or primarily nothing to do
> with a user directory.
> 
> jmf

On invocation of IDLE, sys.path does contain the path to home 
directory  (on nix /home/<name>; on my PC it is /home/ak) In 
Bash that home directory is accessible through bash variable 
$HOME.  Once a program is executed from the "Python Shell" (of 
IDLE), the $HOME directory is replace by the directory of the 
program, whatever that is.  Yes, sys.path is dynamic and it can 
be easily changed from Python, but the changes are discarded 
once the Python is restarted.  Hence my interest in shell 
variable PYTHONPATH, accessible from bash as $PYTHONPATH. 

I have no need of Windows and no longer use it at all, yet I 
want my programs to be portable to all main platforms, hence my 
enthusiastic support for all things Python.

Thanks for all contributions and ALL includes windows et al.

OldAl. 
-- 
Algis
http://akabaila.pcug.org.au/StructuralAnalysis.pdf

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


Thread

PYTHONPATH Algis Kabaila <akabaila@pcug.org.au> - 2011-04-15 18:33 +1000
  Re: PYTHONPATH harrismh777 <harrismh777@charter.net> - 2011-04-15 23:16 -0500
    Re: PYTHONPATH Algis Kabaila <akabaila@pcug.org.au> - 2011-04-16 17:28 +1000
    Re: PYTHONPATH jmfauth <wxjmfauth@gmail.com> - 2011-04-16 03:03 -0700
      Re: PYTHONPATH Algis Kabaila <akabaila@pcug.org.au> - 2011-04-16 20:57 +1000
      Re: PYTHONPATH harrismh777 <harrismh777@charter.net> - 2011-04-17 01:14 -0500
        Re: PYTHONPATH Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-04-17 08:43 +0000
          Re: PYTHONPATH harrismh777 <harrismh777@charter.net> - 2011-04-17 23:37 -0500
            Re: PYTHONPATH MRAB <python@mrabarnett.plus.com> - 2011-04-18 16:31 +0100

csiph-web