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


Groups > comp.lang.python > #19481

Re: import fails in non-interactive interpreter

Date 2012-01-26 11:58 +0100
From Jean-Michel Pichavant <jeanmichel@sequans.com>
Subject Re: import fails in non-interactive interpreter
References <9115def9-c2f6-4ac9-ae4b-8b1b8867ba7b@c21g2000yqi.googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.5117.1327575523.27778.python-list@python.org> (permalink)

Show all headers | View raw


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

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


Thread

import fails in non-interactive interpreter Brian <brian.brinegar@gmail.com> - 2012-01-25 18:25 -0800
  Re: import fails in non-interactive interpreter Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-01-25 22:04 -0500
  Re: import fails in non-interactive interpreter Jean-Michel Pichavant <jeanmichel@sequans.com> - 2012-01-26 11:58 +0100
  Re: import fails in non-interactive interpreter Brian Brinegar <brian.brinegar@gmail.com> - 2012-01-26 07:47 -0500
  Re: import fails in non-interactive interpreter Jean-Michel Pichavant <jeanmichel@sequans.com> - 2012-01-26 14:49 +0100
  Re: import fails in non-interactive interpreter Brian Brinegar <brian.brinegar@gmail.com> - 2012-01-26 09:37 -0500

csiph-web