Ticket #3397 defect closed invalid
Windows Install Problem
| Reported by: | yakka | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | core | Keywords: | |
| Cc: | Branch: | ||
| Author: | Launchpad Bug: |
Description
I’m having trouble getting twisted to work with windows. What am I doing wrong?
Initially I installed just the base twisted. I got the “spawnProcess not available since pywin32 is not installed” error so I installed http://www.activestate.com. I still had problems so I went back to the www.python.org install and installed pycrypt and pyopenssl. I had problems with not finding a dll so I tried http://www.slproweb.com ssl but that caused other problems so I uninstalled it. I’m using the latest version of python, pycrypt and pyopenssl. Now when I run the code below, I get the error
Traceback (most recent call last):
File "C:\Documents and Settings\Brian Downing\Desktop\PythonDev\pyEdaInterface\run_dir.py", line 41, in <module>
reactor.spawnProcess(pp, "dir")
File "C:\Python25\lib\site-packages\twisted\internet\posixbase.py", line 237, in spawnProcess
raise NotImplementedError, "spawnProcess not available since pywin32 is not installed."
NotImplementedError: spawnProcess not available since pywin32 is not installed.
------------------------------------------
My code is:
#uses twisted to call <dir> command # based on http://twistedmatrix.com/projects/core/documentation/howto/process.html section "Verbose Example"
from twisted.internet import protocol from twisted.internet import reactor
class PPDir(protocol.ProcessProtocol):
def init(self):
print "PPDir init called"
def connectionMade(self):
print "connectionMade!"
def outReceived(self, data):
print "outReceived! with %d bytes!" % len(data) print " data %s" % data
def errReceived(self, data):
print "errReceived! with %d bytes!" % len(data) print " data %s" % data
def inConnectionLost(self):
print "inConnectionLost! stdin is closed! (we probably did it)"
def outConnectionLost(self):
print "outConnectionLost! The child closed their stdout!"
def errConnectionLost(self):
print "errConnectionLost! The child closed their stderr."
def processEnded(self, status_object):
print "processEnded, status %d" % status_object.value.exitCode print "quitting" reactor.stop()
pp = PPDir() reactor.spawnProcess(pp, "dir") reactor.run()
#import win32process #self.transport.closeStdin() # tell them we're done #pp = MyPP(10) #reactor.spawnProcess(pp, "wc", wc?, {}) #reactor.run()
print "run_dir 5"
