Skip to main content
 首页 » 编程设计

python之在 AWS 上运行 Twisted 的问题

2025年05月04日9mengfanrong

首先,我需要在我的服务器上运行扭曲的应用程序,但我得到的是这个错误

File "server2.py", line 1, in <module> 
from twisted.internet.protocol import Factory, Protocol 
File "/usr/lib64/python2.6/site-packages/Twisted-15.0.0-py2.6-linux-x86_64.egg/twisted/__init__.py", line 53, in <module> 
_checkRequirements() 
File "/usr/lib64/python2.6/site-packages/Twisted-15.0.0-py2.6-linux-x86_64.egg/twisted/__init__.py", line 51, in _checkRequirements 
raise ImportError(required + ".") 
ImportError: Twisted requires zope.interface 3.6.0 or later. 

所以,这让我安装了 zope.interface。在 zope.interface-4.1.2 中运行 setup.py 后,我看到了这个

Finished processing dependencies for zope.interface==4.1.2 

我想我已经更新了它,但是当我运行我扭曲的应用程序时,出现了同样的错误。请帮助我。

请您参考如下方法:

您使用的是哪个 Linux 发行版/AMI? 您是否检查过是否安装了多个 python 版本? 也许 zope.interface 需要 c-binding 库,你最好从 apt-get/yum 安装这个包?