【问题标题】:Why do I get "ImportError: Twisted requires zope.interface 3.6.0 or later." when running stratum mining proxy?为什么我会收到“ImportError:Twisted 需要 zope.interface 3.6.0 或更高版本。”运行地层挖掘代理时?
【发布时间】:2014-05-22 11:37:54
【问题描述】:

运行“sudo python ./mining_proxy.py”时的整个返回是:

Traceback (most recent call last):
  File "./mining_proxy.py", line 67, in <module>
    from twisted.internet import reactor, defer
  File "/Library/Python/2.7/site-packages/Twisted-13.2.0-py2.7-macosx-10.8-intel.egg/twisted/__init__.py", line 53, in <module>
    _checkRequirements()
  File "/Library/Python/2.7/site-packages/Twisted-13.2.0-py2.7-macosx-10.8-intel.egg/twisted/__init__.py", line 51, in _checkRequirements
    raise ImportError(required + ".")
ImportError: Twisted requires zope.interface 3.6.0 or later.

这让我相信 zope.interface 没有安装。所以我尝试安装它:

sudo easy_install zope.interface
Searching for zope.interface
Best match: zope.interface 4.1.1
Processing zope.interface-4.1.1-py2.7-macosx-10.8-intel.egg
zope.interface 4.1.1 is already the active version in easy-install.pth

Using /Library/Python/2.7/site-packages/zope.interface-4.1.1-py2.7-macosx-10.8-intel.egg
Processing dependencies for zope.interface
Finished processing dependencies for zope.interface

我还找到this post,它说您基本上需要将 init.py 放入文件夹中。所以我这样做:

sudo touch /usr/local/lib/python2.7/site-packages/zope.interface-4.1.1/__init__.py

我尝试再次运行挖矿代理,同样的错误。请帮忙。

【问题讨论】:

  • 请检查zope.__version__ 好吗?
  • @Lafada 我不确定你的意思。文件夹显示 4.1.1。否则我该如何检查?

标签: python python-2.7 twisted osx-mountain-lion zope.interface


【解决方案1】:

我有同样的错误。

谷歌搜索后,我发现触摸应该在不同的地方:

sudo touch /usr/local/lib/python2.7/site-packages/zope/__init__.py

但是没有用。

我刚刚使用 virtualenv 修复了它

这里的步骤:

pip install virtualenv virtualenvwrapper
mkvirtual stratum-proxy
pip install https://github.com/slush0/stratum-mining-proxy.git
pip install zope2

在 virtualenv 层代理中的这些步骤成功运行之后。 希望对你有帮助

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-02-12
    • 1970-01-01
    • 2014-12-07
    • 2023-03-21
    • 2013-07-16
    • 1970-01-01
    • 2017-10-15
    • 2023-03-03
    相关资源
    最近更新 更多