Yes, I noticed that Bio.config.Bio is indeed in sys.modules after importing Bio from the command line, so as you say it must be created at runtime.
The fact remains that Bio trips up ihooks - it will be up to the Python people to treat this as a bug in ihooks or just blame BioPython for not playing well.
Thanks, Michael
Chris Gahan wrote:
On 06 May 2004, Michael Palmer said:
Bio.config exists, whereas Bio.config.Bio indeed does not.[..snip..]
File "C:\PYTHON23\lib\ihooks.py", line 174, in load_package
return imp.load_module(name, file, filename, ("", "",
PKG_DIRECTORY)) File "C:\PYTHON23\Lib\site-packages\Bio\__init__.py", line 106, in ?
_load_registries()
File "C:\PYTHON23\Lib\site-packages\Bio\__init__.py", line 83, in
_load_registries config_imports = __import__("Bio.config", {}, {}, ["Bio"])
File "C:\PYTHON23\lib\ihooks.py", line 403, in import_module
self.ensure_fromlist(m, fromlist)
File "C:\PYTHON23\lib\ihooks.py", line 470, in ensure_fromlist
raise ImportError, "No module named " + subname
ImportError: No module named Bio.config.Bio
Hmm... Judging by the traceback you pasted, ihooks.py is doing what it's supposed to...
Bio/__init__.py is trying to execute: config_imports = __import__("Bio.config", {}, {}, ["Bio"])
Which is equivalent to: from Bio.config import Bio
And that's equivalent to: import Bio.config.Bio Bio = Bio.config.Bio
So, if the code in __init__.py is correct, the module "Bio.config.Bio" should exist.
Load up a python interpreter (or whatever environment can load the Bio module properly), import Bio as you normally would when using it in your program, and then check if the Bio.config.Bio module exists. Maybe there's something sneaky going on inside Bio where it's creating that symbol at runtime, and ihooks isn't finding it because it's looking at the filesystem to resolve module names.
-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss
--
Michael Palmer University of Waterloo Dept. of Chemistry 200 University Ave. West Waterloo, ON N2L 3G1 Canada
Email: [EMAIL PROTECTED] URL: http://www.science.uwaterloo.ca/~mpalmer/ Phone: (519) 888 4567 ext. 5100 Fax: (519) 746 0435
-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss