Newbie packages Q

Alex Martelli aleax at mac.com
Sun Oct 7 16:31:26 EDT 2007


MarkyMarc <marcsgbrevkonto at gmail.com> wrote:
   ...
> > > > > And sys.path is  /python/Test/bpack
> >
> > sys.path must be a LIST.  Are you saying you set yours to NOT be a list,
> > but, e.g., a STRING?!  (It's hard to tell, as you show no quotes there).
   ...
> > > I also tried to put /python/ and /python/Test in the sys.path same
> > > result.
> >
> > If the only ITEM in the list that is sys.path is the string '/python',
> > then any Python code you execute will be able to import Test.apack (as
> > well as Test.bpack, or just Test).
> 
> Of course I have more than just the /python string in the sys.path.
> I have a list of paths, depending on which system the code run on.

As long as '/python' comes in the list before any other directory that
might interfere (by dint of having a Test.py or Test/__init__.py), and
in particular in the non-pathological case where there are no such
possible interferences, my assertion here quoted still holds.

If you're having problems in this case, run with python -v to get
information about all that's being imported, print sys.path and
sys.modules just before the import statement that you think is failing,
and copy and paste all the output here, incuding the traceback from said
failing import.


Alex



More information about the Python-list mailing list