Hello List, I'm contemplating using web2 to implement a web service, and tried out the simple.py "very simple server" example from the twisted.web2 introduction. But it's not working for me. Apparently I've got some kind of version conflict. I'm using the latest Ubuntu python2.4-twisted packages. Is there a web2 version problem? Should I just use twisted web? thanks, George Here are the contents of my _version.py: # This is an auto-generated file. Use admin/change-versions to update. from twisted.python import versions version = versions.Version(__name__[:__name__.rfind('.')], 0, 2, 0) Here is the output from simple.py: $ twistd -ny simple.py 2007/01/16 17:27 EST [-] Log opened. 2007/01/16 17:27 EST [-] twistd 2.0.1 (/usr/bin/python2.4 2.4.2) starting up 2007/01/16 17:27 EST [-] reactor class: twisted.internet.selectreactor.SelectReactor 2007/01/16 17:27 EST [-] Loading simple.py... 2007/01/16 17:27 EST [-] Traceback (most recent call last): 2007/01/16 17:27 EST [-] File "/usr/lib/python2.4/site-packages/twisted/application/app.py", line 156, in getApplication 2007/01/16 17:27 EST [-] application = service.loadApplication(filename, style, passphrase) 2007/01/16 17:27 EST [-] File "/usr/lib/python2.4/site-packages/twisted/application/service.py", line 303, in loadApplication 2007/01/16 17:27 EST [-] application = sob.loadValueFromFile(filename, 'application', passphrase) 2007/01/16 17:27 EST [-] File "/usr/lib/python2.4/site-packages/twisted/persisted/sob.py", line 209, in loadValueFromFile 2007/01/16 17:27 EST [-] exec fileObj in d, d 2007/01/16 17:27 EST [-] File "simple.py", line 3, in ? 2007/01/16 17:27 EST [-] from twisted.web2 import server, http, resource, channel 2007/01/16 17:27 EST [-] File "/usr/lib/python2.4/site-packages/twisted/web2/__init__.py", line 12, in ? 2007/01/16 17:27 EST [-] from twisted.web2._version import version 2007/01/16 17:27 EST [-] File "/usr/lib/python2.4/site-packages/twisted/web2/_version.py", line 2, in ? 2007/01/16 17:27 EST [-] from twisted.python import versions 2007/01/16 17:27 EST [-] ImportError: cannot import name versions 2007/01/16 17:27 EST [-] Failed to load application: cannot import name versions 2007/01/16 17:27 EST [-] Traceback (most recent call last): File "/usr/bin/twistd", line 25, in ? run() File "/usr/lib/python2.4/site-packages/twisted/scripts/twistd.py", line 195, in run app.run(runApp, ServerOptions) File "/usr/lib/python2.4/site-packages/twisted/application/app.py", line 271, in run runApp(config) File "/usr/lib/python2.4/site-packages/twisted/scripts/twistd.py", line 185, in runApp application = app.getApplication(config, passphrase) --- <exception caught here> --- File "/usr/lib/python2.4/site-packages/twisted/application/app.py", line 156, in getApplication application = service.loadApplication(filename, style, passphrase) File "/usr/lib/python2.4/site-packages/twisted/application/service.py", line 303, in loadApplication application = sob.loadValueFromFile(filename, 'application', passphrase) File "/usr/lib/python2.4/site-packages/twisted/persisted/sob.py", line 209, in loadValueFromFile exec fileObj in d, d File "simple.py", line 3, in ? from twisted.web2 import server, http, resource, channel File "/usr/lib/python2.4/site-packages/twisted/web2/__init__.py", line 12, in ? from twisted.web2._version import version File "/usr/lib/python2.4/site-packages/twisted/web2/_version.py", line 2, in ? from twisted.python import versions exceptions.ImportError: cannot import name versions Failed to load application: cannot import name versions 2007/01/16 17:27 EST [-]
George Pauly wrote:
Hello List,
I'm contemplating using web2 to implement a web service, and tried out the simple.py "very simple server" example from the twisted.web2 introduction.
But it's not working for me. Apparently I've got some kind of version conflict. I'm using the latest Ubuntu python2.4-twisted packages.
Is there a web2 version problem? Should I just use twisted web?
twisted.web2 is in active development, therefore you should use code as recent as possible. Your package name tells me that you're still on Ubuntu Dapper, which has the old 2.2 Twisted version, or on an even older Ubuntu version. Use at least the 2.5 Twisted release, or even better the repository. -- Nicola Larosa - http://www.tekNico.net/ Watch the woman's hands, as she talks to the man As he talks down to her, as he tells her He doesn't understand, he doesn't see the fisted hands Clenched tightly, angrily -- Paula Cole, Watch the Woman's Hands, Harbinger, 1994
participants (2)
-
George Pauly -
Nicola Larosa