Repository navigation
Description
I can't install bcrypt (and any other libraries, that used cffi in compile time).
Requirement already satisfied: cffi>=1.1 in ./venv/cross/lib/python3.6/site-packages (from bcrypt) Requirement already satisfied: six>=1.4.1 in ./venv/cross/lib/python3.6/site-packages (from bcrypt) Requirement already satisfied: pycparser in ./venv/cross/lib/python3.6/site-packages (from cffi>=1.1->bcrypt) Installing collected packages: bcrypt Running setup.py install for bcrypt ... error Complete output from command /root/source/venv/cross/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-y3sc7gpk/bcrypt/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-pw2_2nbg-record/install-record.txt --single-version-externally-managed --compile --install-headers /root/source/venv/cross/include/site/python3.6/bcrypt: ******************************************************* * Crossenv has leaked into another Python interpreter! * You should probably file a bug report. * Version 3.6.0 (default, Nov 7 2018, 18:40:18) [GCC 5.4.0 20160609] * Executable /root/source/venv/cross/bin/python3 ******************************************************* Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-build-y3sc7gpk/bcrypt/setup.py", line 238, in <module> **keywords_with_side_effects(sys.argv) File "/root/source/staging_dir/target-mipsel_24kc_musl-1.1.16/host/lib/python3.6/distutils/core.py", line 108, in setup _setup_distribution = dist = klass(attrs) File "/root/source/venv/build/lib/python3.6/site-packages/setuptools/dist.py", line 318, in __init__ _Distribution.__init__(self, attrs) File "/root/source/staging_dir/target-mipsel_24kc_musl-1.1.16/host/lib/python3.6/distutils/dist.py", line 281, in __init__ self.finalize_options() File "/root/source/venv/build/lib/python3.6/site-packages/setuptools/dist.py", line 376, in finalize_options ep.load()(self, ep.name, value) File "/root/source/venv/cross/lib/python3.6/site-packages/cffi/setuptools_ext.py", line 204, in cffi_modules add_cffi_module(dist, cffi_module) File "/root/source/venv/cross/lib/python3.6/site-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module execfile(build_file_name, mod_vars) File "/root/source/venv/cross/lib/python3.6/site-packages/cffi/setuptools_ext.py", line 25, in execfile exec(code, glob, glob) File "src/build_bcrypt.py", line 21, in <module> ffi = FFI() File "/root/source/venv/cross/lib/python3.6/site-packages/cffi/api.py", line 46, in __init__ import _cffi_backend as backend ImportError: /root/source/venv/cross/lib/python3.6/site-packages/_cffi_backend.cpython-36.so: wrong ELF class: ELFCLASS32
As you can see, installing via pip completes for cffi, and then fails for bcrypt because _cffi_backend.cpython-36.so compiled for HOST platform, but used in compile time on the BUILD machine.
Activity
benfogle commentedon Nov 30, 2018
Sorry about the delay in getting back to you. Hopefully this is an easy fix: try running
build-pip install cffiprior topip install bcrypt. That will cause cross-python to pick up the correct backend .so file.