Unable to install twisted package on windows machi

2020-07-09 08:37发布

问题:

I have got python2.6 installed on my windows machine.

tried to install twisted package but unable to install it.

Also installed the zope interface

On the python interpretor I get the error as :

  >>>import twisted
  >>>Import Error: No Module named twisted

I installed the package twisted succesfully.

C:\Documents and Settings\tazim_kolhar>python
Python 2.6 (r26:66721, Oct  2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)] on win 
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import twisted
>>> ^Z

But when, I try to run the script containing the package :

C:\Documents and Settings\tazim_kolhar>cd ..

C:\Documents and Settings>cd ..

C:\>cd Python_scripts


C:\Python_scripts>python aimbot.py
aimbot.py:10: DeprecationWarning: twisted.words.protocols.toc is deprecated sinc
e Twisted 9.0.  Use twisted.words.protocols.oscar instead.
from twisted.words.protocols import toc
Traceback (most recent call last):
File "aimbot.py", line 10, in <module>
from twisted.words.protocols import toc
File "C:\Python26\Lib\site-packages\twisted\words\protocols\toc.py", line 27,
in <module>
from twisted.internet import reactor, protocol
File "C:\Python26\Lib\site-packages\twisted\internet\reactor.py", line 37, in
<module>
from twisted.internet import selectreactor
File "C:\Python26\Lib\site-packages\twisted\internet\selectreactor.py", line 1
7, in <module>
from zope.interface import implements
ImportError: No module named zope.interface

C:\Python_scripts>

I have downloded the zope interface . But the document http://twistedmatrix.com/trac/wiki/WindowsBuilds does not clearly explain about the zope interface.

How do I install this zope interface ?

Any help will be valuable .

Thanks, Tazim.

回答1:

The steps to install the package are as follows :

  1. Install python any version .

  2. Then, Install the appropriate exe

    http://twistedmatrix.com/trac/wiki/Downloads

    Twisted 10.1.0 for Python 2.6 ( msi | exe) or Twisted 10.1.0 for Python 2.5 ( msi | exe)

  3. download the zope interface .

    http://twistedmatrix.com/trac/wiki/Downloads

  4. Install setuptools

    http://pypi.python.org/pypi/setuptools#downloads

    Update the PATH variable to the subdirectory containing easy_install.exe .

  5. install zope interface using :

    easy_install zope.interface-3.6.1-py2.5-win32.egg



回答2:

The documentation for building Twisted on Windows is here. Follow that and you should not face any problem.

Since the import fails, clearly something is not right, so you should follow the steps in the manual above.



回答3:

I've just installed Twisted-12.3.0 using the .msi download.

For the zope interface I extracted the archive (zope.interface-4.0.3-py2.7-win32.egg) and moved the extracted zope directory into the python/lib directory.

I got the usage message when running trial.py in a command window.

(I thought I saw some issue with 64 bit windows and setuptools????)