Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.01; 'interpreter': 0.05; 'interpreter.': 0.07; 'subject:fails': 0.07; 'python': 0.08; 'absent': 0.09; 'cc:addr:python-list': 0.15; '"import': 0.16; 'executed.': 0.16; 'subject:import': 0.16; 'subject:non': 0.16; 'wrote:': 0.16; 'cheers,': 0.20; 'cc:no real name:2**0': 0.21; 'header:In-Reply-To:1': 0.22; '2.5,': 0.23; 'cc:2**0': 0.25; 'mode': 0.25; 'module': 0.26; 'import': 0.27; "i'm": 0.27; 'module.': 0.28; 'print': 0.29; 'installed': 0.29; 'cc:addr:python.org': 0.29; 'environment': 0.30; "i've": 0.31; 'header:User-Agent:1': 0.33; 'someone': 0.34; 'identical': 0.34; 'brian': 0.35; 'file': 0.35; 'variables': 0.36; 'but': 0.37; 'using': 0.37; 'hoping': 0.38; 'but,': 0.38; 'greatly': 0.39; 'subject:: ': 0.39; 'under': 0.40; 'more': 0.61; 'here': 0.64; 'to:name:brian': 0.84; 'thoughts,': 0.93 X-IronPort-AV: E=Sophos;i="4.71,573,1320620400"; d="scan'208";a="104976" X-Virus-Scanned: amavisd-new at zimbra.sequans.com Date: Thu, 26 Jan 2012 11:58:41 +0100 From: Jean-Michel Pichavant User-Agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100328) MIME-Version: 1.0 To: Brian Subject: Re: import fails in non-interactive interpreter References: <9115def9-c2f6-4ac9-ae4b-8b1b8867ba7b@c21g2000yqi.googlegroups.com> In-Reply-To: <9115def9-c2f6-4ac9-ae4b-8b1b8867ba7b@c21g2000yqi.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1327575523 news.xs4all.nl 6924 [2001:888:2000:d::a6]:57626 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:19481 Brian wrote: > I've been banging my head against this for the past hour, and I'm > hoping someone here can set me straight. > > [Snip] > but, using the same same python, I'm able to import the module from > the interactive interpreter. The PATH and PYTHONPATH environment > variables are identical in both contexts. > Are you sure ? with python 2.5, in interactive mode '' is happened to sys.path and is absent from it when a python file is executed. python -c "import sys; print '' in sys.path" True python test.py False > Under what situations would a module be available to through the > interactive interpreter but not the non-interactive? > > I greatly appreciate any thoughts, > Brian > As a more general notice, if you want to be able to import paste from everywhere, it must be properly installed as a python module. Cheers, JM