Python 无法在 Windows 机器上安装扭曲的包

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4182419/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-18 14:39:03  来源:igfitidea点击:

Unable to install twisted package on windows machine

pythonwindowstwisted

提问by Star123

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

我已经在我的 Windows 机器上安装了 python2.6。

tried to install twisted package but unable to install it.

试图安装扭曲的包,但无法安装。

Also installed the zope interface

还装了zope接口

On the python interpretor I get the error as :

在 python 解释器上,我得到的错误是:

  >>>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/WindowsBuildsdoes not clearly explain about the zope interface.

我已经下载了 zope 界面。但是文档http://twistedmatrix.com/trac/wiki/WindowsBuilds并没有清楚地解释 zope 界面。

How do I install this zope interface ?

我如何安装这个 zope 界面?

Any help will be valuable .

任何帮助都是有价值的。

Thanks, Tazim.

谢谢,塔齐姆。

采纳答案by Star123

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

  1. 安装 python 任何版本。

  2. 然后,安装相应的exe

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

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

  3. 下载zope界面。

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

  4. 安装安装工具

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

    将 PATH 变量更新到包含 easy_install.exe 的子目录。

  5. 使用以下命令安装 zope 界面:

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

回答by user225312

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

在 Windows 上构建 Twisted 的文档在这里。遵循这一点,您应该不会遇到任何问题。

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

由于导入失败,显然有问题,因此您应该按照上面手册中的步骤进行操作。

回答by G O'Rilla

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

我刚刚使用 .msi 下载安装了 Twisted-12.3.0。

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.

对于 zope 接口,我提取了存档(zope.interface-4.0.3-py2.7-win32.egg)并将提取的 zope 目录移动到 python/lib 目录中。

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

在命令窗口中运行 trial.py 时,我收到了使用消息。

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

(我以为我看到 64 位 Windows 和 setuptools 有问题????)