[Twisted-Python] Problems running Twisted

Phil Hunt phil.hunt at tech.mrc.ac.uk
Fri Feb 20 06:04:06 EST 2004


On Friday 20 Feb 2004 10:06 am, Andrew Bennetts wrote:
> On Fri, Feb 20, 2004 at 09:48:32AM +0000, Phil Hunt wrote:
> > I'm trying to set up a (very simple) web server using Twisted.
> > Python complains that it can't import twisted.web:
> >
> >    Traceback (most recent call last):
> >      File "teg1.py", line 3, in ?
> >        from twisted.web import server, resource
> >    ImportError: No module named twisted.web
> >
> > I've previously installed Twisted by running:
> >
> >    $ python setup.py install
> >
> > which I thought would install all the modules and put them correctly
> > in the PYTHONPATH (tell me if this isn't true).
>
> It should... what platform are you on?

Python 2.3.3 on Mandrake 9.1.

On further inspection, it appears the situation is more complicated.
When logged in as phunt, I'm running Python 2.3.3 located at 
/opt/local/bin/python 

When running as root I'm running Python 2.2.2 located at /usr/bin/python

I ran setup.py as root (because phunt didn't have the right priviledges).

(Unfortunately I didn't install this box -- lots of stuff is in non-standard
places).

It appears that <setup.py> has set it up in locations appropriate to root.
I've tested this by running <teg1.py> as root and... guess what, it works;
when I point my webserver at <http://localhost:8080/> I get the "Hello 
World" message. 

-- 
Phil Hunt, phil.hunt at tech.mrc.ac.uk




More information about the Twisted-Python mailing list