Having trouble importing against PP2E files

Charles Krug cdkrug at worldnet.att.net
Sat Jul 9 19:24:16 CEST 2005


On Fri, 08 Jul 2005 22:43:55 +0300, Elmo Mäntynen <elmo13 at jippii.fi>
wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
>> Import Error: no module named PP2E.launchmodes
>> 
>> However if I copy launchmodes.py into my work directory, it imports
>> successfully.
>> 
>> Both "Examples" above and "Examples\PP2E" contain the __init__.py file.
> Are both Examples and PP2E packages? 

They appear to be, yes.

> In python if a folder is meant to represent a package it should iclude
> the above mentioned file __init__.py and by saying the above your
> suggesting that PP2E is a package inside the package Examples.

That appears to be the case, yes.

> If the above is correct, you should append the pythonpath with
> c:\Python24\ and refer to the wanted .py with Examples.PP2E.launchmodes.
> As such the import statement obviously should be "from
> Examples.PP2E.launchmodes import PortableLauncher". If the above isn't
> the case and there is still something unclear about this, reply with a
> more detailed post about the situation.
> 

The registry value is this:

C:\Python24\Lib;C:\Python24\DLLs;C:\Python24\Lib\lib-tk;
C:\Python24\Examples\PP2E

I'm not realy sure what other details are relavant.  I've installed from
the Windows .msi package, and appended the directory I want to
PythonPath in the registry, and that doesn't do what I need.

This is WinXP Pro




More information about the Python-list mailing list