George Wright | 2 Dec 12:12 2008
Picon

error: "No module named strcred"

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.
For example:
$ twistd twistd --help

geomacbk:~ georgewr$ twistd --help
Traceback (most recent call last):
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/ 
Extras/lib/python/twisted/python/usage.py", line 373, in __str__
     return self.getSynopsis() + '\n' + self.getUsage(width=None)
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/ 
Extras/lib/python/twisted/python/usage.py", line 407, in getUsage
     for (cmd, short, parser, desc) in self.subCommands:
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/ 
Extras/lib/python/twisted/application/app.py", line 364, in subCommands
     for plug in plugins:
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/ 
Extras/lib/python/twisted/plugin.py", line 227, in getPlugins
     allDropins = getCache(package)
--- <exception caught here> ---
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/ 
Extras/lib/python/twisted/plugin.py", line 178, in getCache
     provider = namedAny(module.__name__ + '.' + moduleName)
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/ 
Extras/lib/python/twisted/python/reflect.py", line 357, in namedAny
     topLevelPackage = __import__(trialname)
   File "/Users/georgewr/Library/Python/2.5/site-packages/twisted/ 
(Continue reading)

Jean-Paul Calderone | 2 Dec 15:20 2008

Re: error: "No module named strcred"

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
(Continue reading)

George Wright | 3 Dec 09:35 2008
Picon

Re: error: "No module named strcred"

Thanks Jean-Paul
One version of twisted (system/library etc) was 2.5! I don't know how it got there. Maybe it was included in the Apple OSX and I shouldn't trash it?
Anyhow I did easy_install -U twisted and got version 8.1 and things seem OK now.

On 03/12/2008, at 4:00 AM, Jean-Paul Calderone <exarkun <at> divmod.com> wrote:

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/.   

you should try upgrading one of the installations to 8.1 and then make sure
it comes first in PYTHONPATH.  

Jean-Paul


_______________________________________________
Twisted-web mailing list
Twisted-web <at> twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
Swapnil Manthanwar | 3 Dec 11:00 2008
Picon

Problem with twisted.web2.

Hi All,

 

 

I have deployed all the dependencies required for OpenXCAP server but when I run openxcap, I get an error;

Traceback (most recent call last):

  File "/usr/local/bin/openxcap", line 41, in <module>

    from xcap.logutil import start_log

  File "/usr/local/lib/python2.5/site-packages/xcap/logutil.py", line 6, in <module>

    from twisted.web2 import responsecode

ImportError: No module named web2

It may require the latest version of twisted.web2. I tried on “svn://svn.twistedmatrix.com/svn/Twisted/trunk“to download the latest version but failed.

Please let me know if I can get the latest twisted.web2 from any other location.

 

 

Thanks in advance,

-Swapnil

 

 

DISCLAIMER ========== This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

_______________________________________________
Twisted-web mailing list
Twisted-web <at> twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
Dot Fill | 4 Dec 14:51 2008
Picon

wsgi and twisted.web{,2} again

I know, people on this list dislike WSGI as a matter of principle,
so don't kick me into head before I have spoken the rest...
Sorry for my English too.

I do really appreciate the original mood of nevow, the clean and creative
approach of twisted, that is to be said. AFAIK, they are both OpenSource
developments, and being developed by community. So the only thing they both
need is the wide acceptance by the public, to be enhanced more and more
and to keeping it alive too.

But here just want to say, that I am unhappy with the fact that nevow is a
framework of it's own server and is not a more general thing.
I suppose that I am not alone in that unhappiness.
Believe me, sometimes we can't choose all the software we will deploy for
a particular site. Sometimes WSGI hosting is easier to require/ask for.
So what about using twisted as WSGI application or WSGI middleware,
not just only as WSGI gateway?
Is it really technically impossible to run twisted.web2 application on
a WSGI hosting
together with some (thin?) layer of twisted, but without HTTP-server?
AFAIK there is no modules, that already do the job needed. Am I right?

I understand, that adoption of WSGI makes the usage of twisted-based HTTP server
unnecessary and that probably can't be tolerated by several people on this list,
as they have spent too much effort on developing the HTTP server in twisted.
But anyway, the availability of it's own dedicated HTTP server is not the
first argument when advocating the twisted methodology, believe me.
As for me personally - it is the last argument, but this is only IMHO.
The more valuable argument will be the possibility to plug twisted
into any existing
HTTP-server. Consider imaginary apache's "mod_twisted", just imagine
that's power and
flexibility if it will allow to pre-fork twisted process with
specified uids, send
some requests to that process via a secure channel like UNIX-socket.
(Just look at the mod_wsgi and you will get the idea.)

You may notice, that it is already possible with apache as reverse HTTP-proxy,
but:
 - pure-HTTP reverse proxies cannot be nested (for obvious reasons),
 don't giving an example here.
 - HTTP-based application servers cannot securely live inside single
unix operating
 system instance. Consider student's server with Joe and Matthew as
 students, building their twisted application and deploying it on the same
 machine and behind HTTP-reverse proxy. They operate under different
 accounts, but common UNIX system makes no difference on who is trying
 to bind to TCP-socket for listening. Thus, once being drunk after holidays,
 Joe decides to show his coolhacker skills to Matthew and runs application,
 that bind itself continuously to Matthew's TCP port. Matthew sucks, his
 application fails to run. This was a real life example, and in real life
 it was fixed by employing SELinux on public student's server, and as a
 consequence, students lost the feeling of pure-UNIX system's behaviour,
 so that had it's impact on didactic issues of using student's server.
   That could be fixed easily if UNIX sockets were used instead of
 internet-sockets, but for that time we had no reverse proxy with
 UNIX-sockets supported nor we had working twisted application,
 implementing HTTP-over-UNIX-socket protocol.
 - indeed, you will probably (dis)agree that HTTP in it's design, history of
 deployment, together with complications of tons of differently behaving
 HTTP-client implementations, etc, etc is NOT A PERFECT solution for
 protocol of interchanging with binary messages between two automated
 systems (remember the need for unnecessary escaping/unescaping? what does it
 bring to automated systems' dialogue? only unnecessary complexity, right?).
 - OK, it is not perfect, but it works and is widely adopted and
 accepted, but even then is it so ideal to be used everywhere as a versatile
 protocol?

So why is it not so useful to formalize the interface between the HTTP-server
and the application? CGI was an attempt and it showed, that while being
quite universal, it brings too much overhead to the whole process. That's
why there happened to appear FastCGI and it's emulations and followers.
FastCGI were accepted not for it's best design decisions, but for solving
the CGI problem.
Perhaps you, people, have strong arguments against WSGI at it's current state.
But I can't believe, that there can exist valuable arguments against the idea
of such interface in general.
If there are some, I am interested to know that.

PS: Not trying to start a flame war, ignore the post if you feel suspicious.

PPS: Please, people, understand that you have done a great work, invented
     (or just implemented?) some really useful and insightful approaches in
     the area. But it all may get lost among the alikes and may get lost in the
     history of the web development, if it will continue to be so specific and
     inflexible (without a real visible need). I will personally be so
unhappy for that
     happens.
Jean-Paul Calderone | 4 Dec 15:22 2008

Re: wsgi and twisted.web{,2} again

On Thu, 4 Dec 2008 17:51:20 +0400, Dot Fill <dotfill <at> gmail.com> wrote:
>I know, people on this list dislike WSGI as a matter of principle,
>so don't kick me into head before I have spoken the rest...

It seems you put a lot of thought into this.  I could argue with various
points that you've made, but I'll just skip to the end instead.  If you'd
like to contribute support to Twisted Web or Nevow for running in a WSGI
container, then we'll accept it and maintain it (with all of the usual
caveats about documentation, test coverage, etc).  In case there is any
confusion caused by the recent deprecation of Nevow's wsgi module, this
was done because that module didn't meet quality requirements, not because
we think there is no place for such functionality in Nevow (although from
an implementation perspective, it *would* be preferable if a Twisted Web
WSGI module could provide this feature for both Twisted Web *and* Nevow).

Due to the current roadmap for Twisted Web and Twisted Web2, I would not
encourage you to contribute Twisted Web2 WSGI support, though.

>Sorry for my English too.

Your English is great. :)

Jean-Paul
James Y Knight | 5 Dec 02:24 2008
Picon

Re: wsgi and twisted.web{,2} again

On Dec 4, 2008, at 9:22 AM, Jean-Paul Calderone wrote:
> Due to the current roadmap for Twisted Web and Twisted Web2, I would  
> not
> encourage you to contribute Twisted Web2 WSGI support, though.

Web2 was written with the goal of allowing many protocols/deployment  
mechanisms to hook up to it: http, cgi, scgi, and maybe-working  
fastcgi are present. WSGI was not omitted because of any hatred of it,  
only because it was simply not done before plans changed.

Anyhow, I agree, it'd be really nice to have that flexibility ported  
back into twisted.web so you could deploy a t.web-based app on top of  
any server you like.

James
s s | 5 Dec 03:13 2008

Re: wsgi and twisted.web{,2} again


On Dec 4, 2008, at 8:24 PM, James Y Knight wrote:

> On Dec 4, 2008, at 9:22 AM, Jean-Paul Calderone wrote:
>> Due to the current roadmap for Twisted Web and Twisted Web2, I  
>> would not
>> encourage you to contribute Twisted Web2 WSGI support, though.
>
> Web2 was written with the goal of allowing many protocols/deployment  
> mechanisms to hook up to it: http, cgi, scgi, and maybe-working  
> fastcgi are present. WSGI was not omitted because of any hatred of  
> it, only because it was simply not done before plans changed.

Speaking of "plans", is there, somewhere, some sort of plan for web2?

After seeing this thread, I went and looked at the roadmap for  
"Milestone Web2-Gold-Master" (http://twistedmatrix.com/trac/milestone/Web2-Gold-Master 
)  and saw that some of the tickets were three years old, many two  
years old, and none newer than 6 months ago.

Is there some "master plan for Web2" somewhere that I've just missed?

Thanks,

S
Maarten ter Huurne | 5 Dec 03:26 2008

Re: wsgi and twisted.web{,2} again

On Friday 05 December 2008, s s wrote:

> Is there some "master plan for Web2" somewhere that I've just missed?

The short version is that the good bits of web2 will be merged into 
twisted.web and the web2 namespace will be phased out.

The full version is here:
  http://twistedmatrix.com/trac/wiki/TwistedWebPlan

Bye,
		Maarten
s s | 5 Dec 03:39 2008

Re: wsgi and twisted.web{,2} again


On Dec 4, 2008, at 9:26 PM, Maarten ter Huurne wrote:

> On Friday 05 December 2008, s s wrote:
>
>> Is there some "master plan for Web2" somewhere that I've just missed?
>
> The short version is that the good bits of web2 will be merged into
> twisted.web and the web2 namespace will be phased out.
>
> The full version is here:
>  http://twistedmatrix.com/trac/wiki/TwistedWebPlan

Ahhhh, the plan!

Any idea when that plan was last updated, what's been done to move  
toward it, or what needs to be done to make it all happen?

Are the 15 remaining tickets in the:

	Milestone Web2-Gold-Master

	relevant and current or does this warrant a new, fresh milestone with  
current tickets reflecting the actual work that needs to be done?

Thanks,

S

Gmane