problem(s) with import from parent dir: "from ../brave.py import sir_robin"

Kent Johnson kent at kentsjohnson.com
Fri Feb 24 08:21:38 EST 2006


per9000 wrote:
>>>>from raw2nice_def import raw2nice

> ----------
> 
> When I tried putting this into a program to execute command-line-style:
> 
> from raw2nice_def.py import raw2nice
> 
> output:
> 
>>"C:\another_bridge\python\python.exe" rawhtml2nicehtml_template.py
> 
> ['raw2nice_def.py', 'raw2nice_def.pyc', 'temp']
> Traceback (most recent call last):
>   File "C:my\holy\grail\that_old_bridge\rawhtml2nicehtml_template.py",
> line 10, in ?
>     from raw2nice_def.py import raw2nice
> ImportError: No module named raw2nice_def.py

Maybe it will work without the .py extension which is the correct form 
for an import (and what worked from the command line).

Kent



More information about the Python-list mailing list