I have observed an error with module importing into a Webware servlet. I want to import some module from the BioPython package (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
/c:\htdocs\watcut\pages\loader\NewProject.py/
Traceback (most recent call last):
File "C:/test/Webware\WebKit\Application.py", line 395, in dispatchRequest
self.handleInvalidSession(transaction)
File "C:/test/Webware\WebKit\Application.py", line 531, in handleInvalidSession
self.handleGoodURL(transaction)
File "C:/test/Webware\WebKit\Application.py", line 562, in handleGoodURL
self.createServletInTransaction(transaction)
File "C:/test/Webware\WebKit\Application.py", line 1048, in createServletInTransaction
inst = self.getServlet(transaction,path,cache)
File "C:/test/Webware\WebKit\Application.py", line 991, in getServlet
inst = factory.servletForTransaction(transaction)
File "C:/test/Webware\WebKit\ServletFactory.py", line 188, in servletForTransaction
module = self.importAsPackage(transaction, path)
File "C:/test/Webware\WebKit\ServletFactory.py", line 108, in importAsPackage
module = self._importModuleFromDirectory(fullname, name, moduleDir, forceReload=1)
File "C:/test/Webware\WebKit\ServletFactory.py", line 139, in
_importModuleFromDirectory
module = imp.load_module(fullModuleName, fp, pathname, stuff)
File "C:/test/Webware\WebKit\ImportSpy.py", line 117, in load_module
return modloader.load_module(name,(file,filename,description))
File "C:/test/Webware\WebKit\ImportSpy.py", line 30, in load_module
mod = ihooks.ModuleLoader.load_module(self, name, stuff)
File "C:\PYTHON23\lib\ihooks.py", line 270, in load_module
m = self.hooks.load_source(name, filename, file)
File "C:\PYTHON23\lib\ihooks.py", line 168, in load_source
return imp.load_source(name, filename, file)
File "c:\htdocs\watcut\pages\loader\NewProject.py", line 5, in ?
from Bio import GenBank
File "C:\PYTHON23\lib\ihooks.py", line 398, in import_module
q, tail = self.find_head_package(parent, str(name))
File "C:\PYTHON23\lib\ihooks.py", line 439, in find_head_package
q = self.import_it(head, qname, parent)
File "C:\PYTHON23\lib\ihooks.py", line 489, in import_it
m = self.loader.load_module(fqname, stuff)
File "C:/test/Webware\WebKit\ImportSpy.py", line 30, in load_module
mod = ihooks.ModuleLoader.load_module(self, name, stuff)
File "C:\PYTHON23\lib\ihooks.py", line 274, in load_module
m = self.hooks.load_package(name, filename, file)
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--
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
