[Twisted-web] error: "No module named strcred"
Jean-Paul Calderone
exarkun at divmod.com
Tue Dec 2 09:20:59 EST 2008
On Tue, 2 Dec 2008 22:12:01 +1100, George Wright <georgewr at bigpond.net.au> wrote:
>Gidday
>I'm Looking for help.
>Trying to run twisted and twistd examples (such as from here:
>http://www.saltycrane.com/blog/2008/10/running-twisted-perspective-broker-
>example-twistd/)
>I sometimes get a "No module named strcred" error.
One problem is that you have two versions of Twisted installed, one in
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/ and
another in /Users/georgewr/Library/Python/2.5/site-packages/. This should
not pose as great a problem with a newer version of Twisted (such as 8.1)
but older versions incorrectly handled this case. So if it's an option,
you should try upgrading one of the installations to 8.1 and then make sure
it comes first in PYTHONPATH. If one of them is already 8.1, then just
make sure it comes first in PYTHONPATH. Once this is the case, it should
correctly ignore the other older version.
The import error comes from a newer plugin being found which tries to import
a module which didn't exist in the older version of Twisted, but the older
version of Twisted appears on PYTHONPATH first, so when the plugin tries to
import the module, Python finds the older version of Python which does not
have that module, and you get an ImportError.
You can read more about the plugin system (if you're interested) here:
http://twistedmatrix.com/projects/core/documentation/howto/plugin.html
Jean-Paul
More information about the Twisted-web
mailing list