ich arbeite mich gerade in Apache/mod_python und SQLObject ein.
In einer Testanwendung kommt jetzt immer folgender Fehler:
Dieser Fehler tritt genau dann auf, wenn ich mein erstes eigenes Modul mit import einbinden möchte.PythonHandler mod_python.cgihandler: Traceback (most recent call last):
PythonHandler mod_python.cgihandler: File "/usr/lib/python2.5/site-packages/mod_python/apache.py", line 299, in HandlerDispatch\n result = object(req)
PythonHandler mod_python.cgihandler: File "/usr/lib/python2.5/site-packages/mod_python/cgihandler.py", line 96, in handler\n imp.load_module(module_name, fd, path, desc)
PythonHandler mod_python.cgihandler: File "/path/to/my/test/index.py", line 5, in <module>\n from sqlobject import *
PythonHandler mod_python.cgihandler: File "/usr/lib/python2.5/site-packages/SQLObject-0.10.2-py2.5.egg/sqlobject/__init__.py", line 5, in <module>\n from main import *
PythonHandler mod_python.cgihandler: File "/usr/lib/python2.5/site-packages/SQLObject-0.10.2-py2.5.egg/sqlobject/main.py", line 32, in <module>\n import dbconnection
PythonHandler mod_python.cgihandler: File "/usr/lib/python2.5/site-packages/SQLObject-0.10.2-py2.5.egg/sqlobject/dbconnection.py", line 15, in <module>\n import col
PythonHandler mod_python.cgihandler: File "/usr/lib/python2.5/site-packages/SQLObject-0.10.2-py2.5.egg/sqlobject/col.py", line 31, in <module>\n from formencode import compound
PythonHandler mod_python.cgihandler: File "/usr/lib/python2.5/site-packages/FormEncode-1.0.1-py2.5.egg/formencode/__init__.py", line 1, in <module>\n from api import *
PythonHandler mod_python.cgihandler: File "/usr/lib/python2.5/site-packages/FormEncode-1.0.1-py2.5.egg/formencode/api.py", line 10, in <module>\n from pkg_resources import resource_filename
PythonHandler mod_python.cgihandler: File "/usr/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.py", line 2552, in <module>
PythonHandler mod_python.cgihandler: File "/usr/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.py", line 384, in __init__
PythonHandler mod_python.cgihandler: File "/usr/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.py", line 399, in add_entry
PythonHandler mod_python.cgihandler: File "/usr/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.py", line 1614, in find_distributions
PythonHandler mod_python.cgihandler: File "/usr/lib/python2.5/pkgutil.py", line 376, in get_importer\n importer = path_hook(path_item)
PythonHandler mod_python.cgihandler: TypeError: zipimporter() argument 1 must be string, not module
Das geschieht so:
Code: Alles auswählen
import sys
import os
sys.path.append(os.path)
from meinmodul import MeineKlasse
Der Punkt ist, dass allein das Einbinden des Moduls diesen Fehler in der Datei pkgutil.py auslöst, auch wenn ich die Klasse weder erstelle, noch benutze.
Vielleicht ist das ein häufiger Fehler und kann durch eine Code-Änderung vermieden werden. Ich hoffe auf Erfahrung anderer problemgeplagter Leser