thanks very much for your reply. You were right - it is indeed ihooks itself:
>>>import ihooks >>>ihooks.install() >>>import Bio
gives an error. After >>>ihooks.unistall() the import works.
I reported this as a Python bug, as you suggested. Meanwhile, as a workaround, I found that importing the Bio modules into application.py (i.e. into Webware itself) first prevents the error. A dirty hack, of course, but it lets me move on.
Thanks again and best wishes, Michael
Jason Hildebrand wrote:
On Thu, 2004-05-06 at 19:37, Michael Palmer wrote:
(www.biopython.org). If I include the line
from Bio import GenBank
I get the error
File "C:\PYTHON23\lib\ihooks.py", line 470, in ensure_fromlist
raise ImportError, "No module named " + subname
ImportError: No module named Bio.config.Bio
(full traceback below).
Bio.config exists, whereas Bio.config.Bio indeed does not. The import
works fine from the command line, i.e. if Webware and or the standard
lib ihooks module used by it are not involved. I'm not sure whether
to
blame Webware or ihooks. If someone having a more solid understanding
of
Python's nuts and bolts than myself could figure that out, this would
be
much appreciated. Thanks, Michael
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
From the traceback, it looks like that fancy stuff Bio is trying to do init's __init__ (i.e. calling __import__ directly) is incompatible with ihooks. I don't believe that the problem lies with Webware, except in that Webware
relies on ihooks. If you can reduce this to a test case (i.e. a couple of files) which work in standard python but not when ihooks has been enabled, then it would be good to file a bug against ihooks (in the python standard
library).
peace, Jason
-- Jason D. Hildebrand [EMAIL PROTECTED]
--
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
