2012-01-05 38 views
2

我永远不知道如何阅读这些。如果有人能够帮助我理解这一点,那么这将会有所帮助,并且可能就如何阅读这些内容提供建议?有人可以帮我理解这个错误:

D:\>python captain2.py 
Traceback (most recent call last): 
    File "captain2.py", line 2, in <module> 
    from twisted.internet import reactor 
    File "c:\Python27\lib\site-packages\twisted\internet\reactor.py", line 37, in 
<module> 
    from twisted.internet import default 
    File "c:\Python27\lib\site-packages\twisted\internet\default.py", line 50, in 
<module> 
    install = _getInstallFunction(platform) 
    File "c:\Python27\lib\site-packages\twisted\internet\default.py", line 46, in 
_getInstallFunction 
    from twisted.internet.selectreactor import install 
    File "c:\Python27\lib\site-packages\twisted\internet\selectreactor.py", line 1 
4, in <module> 
    from zope.interface import implements 
ImportError: No module named zope.interface 
+0

如果您有pip或easy_install,请尝试运行'sudo pip install zope'或'sudo easy_install zope'并确认您拥有该软件包。 – Stefan 2012-01-05 03:50:26

回答

8

在堆栈追踪中,Python按照调用发生的顺序列出当前调用堆栈。所以,首先你的代码中captain2.py

from twisted.internet import reactor 

然后reactor模块做:

from twisted.internet import default 

,并依此类推,直到selectreactor.py做:

from zope.interface import implements 

,显然不存在一您系统上的zope.interface模块。

+0

您可以从http://pypi.python.org/pypi/zope.interface获取zope.interface – Glyph 2012-01-05 04:22:47

相关问题