简体   繁体   中英

Why do I get “ImportError: Twisted requires zope.interface 3.6.0 or later.” when running stratum mining proxy?

The entire return when running "sudo python ./mining_proxy.py" is:

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.

This leads me to believe that zope.interface is not installed. So I try to install it:

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

I also find this post which says you basically need to put an init .py into the folder. So I do:

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

I try to run mining proxy again, same error. Please help.

I had the same error.

After googling around I found that the touch should be in a different place:

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

however it didn't work.

I just fixed it using virtualenv

steps here:

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

After those step inside the virtualenv stratum-proxy was working successfully. hope it helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM