473,288 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,288 software developers and data experts.

Import removing first module component

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
3 994
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Stian Søiland | last post by:
all examples performed with: Python 2.3+ (#2, Aug 10 2003, 11:09:33) on linux2 (2, 3, 0, 'final', 1) This is a recursive import:
8
by: Grant D. Watson | last post by:
If this has been answered before, or if my terminology is off, please bear with me; my Python experience is limited to use in one class and to personal projects. I'd like to do something rather...
5
by: Steve Holden | last post by:
This is even stranger: it makes it if I import the module a second time: import dbimp as dbimp import sys if __name__ == "__main__": dbimp.install() #k = sys.modules.keys() #k.sort() #for...
16
by: didier.doussaud | last post by:
I have a stange side effect in my project : in my project I need to write "gobal" to use global symbol : .... import math .... def f() : global math # necessary ?????? else next line...
2
by: danielmcbrearty | last post by:
Hi Old hand at perl, giving python a try. Trying to get pymedia running on my winxp box. Have installed activestate python 2.4 and pymedia using precompiled installers. Problem is it SEEMS...
7
by: =?Utf-8?B?Sm9lbCBNZXJr?= | last post by:
I have created a custom class with both value type members and reference type members. I then have another custom class which inherits from a generic list of my first class. This custom listneeds...
10
by: Thomas Guettler | last post by:
If you look at this code, you see there are two kind of ImportErrors: 1. app_name has no attribute or file managment.py: That's OK. 2. managment.py exists, but raises an ImportError: That's not...
2
by: gbin,Zhou | last post by:
Hi,all. I see from "http://docs.python.org/tut/node11.html" that "Name spaces are created at different moments and have different lifetimes. The namespace containing the built-in names is created...
6
by: provor | last post by:
Hello, I have the following code that I am using when a user presses a button to import an excel file into a table. The code is hard coded to point to the correct table. This works great for this...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.