unable to load extension modules compiled with pypy v7.0.0
Closed this issue · 3 comments
I compile this module pypy v7.0.0
pypy setup.py install --record files.txt
When working, I get the following error:
Error while requesting best block header:
Traceback (most recent call last):
File "/usr/local/lib/pypy2.7/dist-packages/twisted/internet/defer.py", line 654, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "/usr/local/lib/pypy2.7/dist-packages/twisted/internet/defer.py", line 1475, in gotResult
_inlineCallbacks(r, g, status)
File "/usr/local/lib/pypy2.7/dist-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/usr/local/lib/pypy2.7/dist-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
--- <exception caught here> ---
File "/opt/lyra2re3/p2pool-vtc/p2pool/util/deferral.py", line 41, in f
result = yield func(*args, **kwargs)
File "/usr/local/lib/pypy2.7/dist-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
result = g.send(result)
File "/opt/lyra2re3/p2pool-vtc/p2pool/node.py", line 218, in poll_header
handle_header((yield self.factory.conn.value.get_block_header(self.bitcoind_work.value['previous_block'])))
File "/opt/lyra2re3/p2pool-vtc/p2pool/node.py", line 200, in handle_header
if not (self.net.PARENT.POW_FUNC(bitcoin_data.block_header_type.pack(new_header)) <= self.bitcoind_work.value['bits'].target):
File "/opt/lyra2re3/p2pool-vtc/p2pool/bitcoin/networks/vertcoin.py", line 17, in <lambda>
POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('lyra2re3_hash').getPoWHash(data))
File "/usr/local/lib/pypy2.7/dist-packages/lyra2re2_hash-1.2.1-py2.7-linux-x86_64.egg/lyra2re3_hash.py", line 7, in <module>
__bootstrap__()
File "/usr/local/lib/pypy2.7/dist-packages/lyra2re2_hash-1.2.1-py2.7-linux-x86_64.egg/lyra2re3_hash.py", line 6, in __bootstrap__
imp.load_dynamic(__name__,__file__)
exceptions.ImportError: unable to load extension module '/usr/local/lib/pypy2.7/dist-packages/lyra2re2_hash-1.2.1-py2.7-linux-x86_64.egg/lyra2re3_hash.pypy-41-x86_64-linux-gnu.so': /usr/local/lib/pypy2.7/dist-packages/lyra2re2_hash-1.2.1-py2.7-linux-x86_64.egg/lyra2re3_hash.pypy-41-x86_64-linux-gnu.so: undefined symbol: _Py_Dealloc
I am not familiar with PyPy but _Py_Dealloc
comes from libpython2.7.a
with CPython.
It is a pity that you do not use, now almost all nodes of p2ool work on PyPy. It is much more efficient than a Python.
Here a similar problem has been solved: dgrunwald/rust-cpython#122 (comment)
But I do not know how to apply it to your sources.
Found how to fix it, there's no error now.
I replaced https://github.com/metalicjames/lyra2re-hash-python/blob/master/setup.py#L1 with from distutils.core import setup Extension
, and it helped.
But after this replacement, the modules are installed in /usr/local/lib/pypy2.7/dist-packages and not in a separate directory