-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Newly compile pyenv on macos broken with: Expected in: flat namespace #1242
Description
I am on High Sierra and I recently discovered that some precompiled wheels stopped working with the newer pyenv versions. Initially I found the errors only with py37 but after upgradinf the other py35,py36 versions it started to reproduce on them too.
I am almost sure that this is caused by the way pyenv compiles python so it endsup being binary incompatible with manylinux wheels.
How to reproduce bug:
pip3 install pycrytpo
python3 -c "from Crypto.Util import _counter"
>>> Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/Users/ssbarnea/.pyenv/versions/3.7.1/lib/python3.7/site-packages/Crypto/Util/_counter.cpython-37m-darwin.so, 2): Symbol not found: _PyInt_FromLong
Referenced from: /Users/ssbarnea/.pyenv/versions/3.7.1/lib/python3.7/site-packages/Crypto/Util/_counter.cpython-37m-darwin.so
Expected in: flat namespace
in /Users/ssbarnea/.pyenv/versions/3.7.1/lib/python3.7/site-packages/Crypto/Util/_counter.cpython-37m-darwin.so
Please note that this has nothing to do with pycrypto package itself as I found the same kind of error on other libraries.
It may work mentioning some environment variables defined on the system:
CFLAGS='-I/usr/local/include -L/usr/local/lib -I/usr/local/opt/openssl/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include'
CPPFLAGS='-I/usr/local/opt/zlib/include -I/usr/local/opt/openssl/include -I/usr/local/opt/nss/include -I/usr/local/opt/icu4c/include -I/usr/local/opt/libarchive/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/ -I/usr/local/opt/sqlite/include'
LDFLAGS='-L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/nss/lib -L/usr/local/opt/libarchive/lib -L/usr/local/opt/icu4c/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib'
As I tried to investigate the issue myself I came across https://stackoverflow.com/a/51384999/99834 which sounds interesting.
Any ideas?
otool-pycrypto.log