By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,907 Members | 1,963 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,907 IT Pros & Developers. It's quick & easy.

Import removing first module component

P: n/a
Have the following line:
import notewave.runner.LMTP

Yeilding the following error:
ImportError: No module named runner.LMTP

For the life of me I don't understand why the first component
"notewave" is being stripped off, when the import is happening.

Thanks,
Jun 27 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
In article
<75**********************************@u6g2000prc.g ooglegroups.com>,
koblas <ko****@gmail.comwrote:
Have the following line:
import notewave.runner.LMTP

Yeilding the following error:
ImportError: No module named runner.LMTP

For the life of me I don't understand why the first component
"notewave" is being stripped off, when the import is happening.
Does notewave contain a _module_ named runner.LMTP ?
Probably not, since the error message says there's no
such module.
Thanks,
--
David C. Ullrich
Jun 27 '08 #2

P: n/a
On Jun 4, 2:48*pm, "David C. Ullrich" <dullr...@sprynet.comwrote:
In article
<75481b47-87ec-4a84-8063-7abbdb286...@u6g2000prc.googlegroups.com>,

*koblas <kob...@gmail.comwrote:
Have the following line:
* * * * import notewave.runner.LMTP
Yeilding the following error:
* * * * ImportError: No module named runner.LMTP
For the life of me I don't understand why the first component
"notewave" is being stripped off, when the import is happening.

Does notewave contain a _module_ named runner.LMTP ?
Probably not, since the error message says there's no
such module.
Thanks,

--
David C. Ullrich
The following exist:
.../notewave/runner/LMTP.py
inside of LMTP.py there is:
class LMTPRunner(Runner) :

Another person pointed out that I should check on the __init__.py and
make sure lmtp is defined in the __all__ block. I didn't have an
__init__.py at that level of the tree, which must have been causing
problems, but clearly I don't understand the full inheritance of
__init__.py and sub-directories.
Jun 27 '08 #3

P: n/a
On Jun 6, 1:44 am, koblas <kob...@gmail.comwrote:
Another person pointed out that I should check on the __init__.py and
make sure lmtp is defined in the __all__ block. I didn't have an
__init__.py at that level of the tree, which must have been causing
problems, but clearly I don't understand the full inheritance of
__init__.py and sub-directories.
Heya,

If you're not sure about packages, it's covered in the python docs
here:

http://docs.python.org/tut/node8.htm...00000000000000

An __all__ variable doesn't have to be defined, the __init__.py can be
empty, as it's the presence of that file that informs python that the
folder is a package. The example in the docs should help you here.
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.