Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error while installing cryptography or cffi on Big Sur #5572

Closed
foozzi opened this issue Nov 16, 2020 · 3 comments
Closed

error while installing cryptography or cffi on Big Sur #5572

foozzi opened this issue Nov 16, 2020 · 3 comments

Comments

@foozzi
Copy link

foozzi commented Nov 16, 2020

  • Python 3.8.2
  • cffi 1.14.3
  • cryptography 3.2.1
  • MacOS: Bug Sur (11.0.1) (macbook pro 2017 without Apple Silicon)

run:

pip3 install cryptography

or run with flags:

sudo CRYPTOGRAPHY_SUPPRESS_LINK_FLAGS="1" LDFLAGS="/usr/local/opt/openssl/lib/libcrypto.a /usr/local/opt/openssl/lib/libssl.a" CFLAGS="-I/usr/local/opt/openssl/install/include" pip3 install cryptography

(or try cffi, same mistake)

error output:

Collecting cryptography
  Using cached cryptography-3.2.1.tar.gz (540 kB)
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/user1/electrum/venv/bin/python /Users/user1/electrum/venv/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/vv/5zc7f2ns7x3dnxrmm01dqm9w0000gn/T/pip-build-env-70l3p56h/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.6.0' wheel 'cffi>=1.8,!=1.11.3; platform_python_implementation != '"'"'PyPy'"'"''
       cwd: None
  Complete output (106 lines):
  Collecting setuptools>=40.6.0
    Using cached setuptools-50.3.2-py3-none-any.whl (785 kB)
  Collecting wheel
    Using cached wheel-0.35.1-py2.py3-none-any.whl (33 kB)
  Collecting cffi!=1.11.3,>=1.8
    Using cached cffi-1.14.3.tar.gz (470 kB)
  Collecting pycparser
    Using cached pycparser-2.20-py2.py3-none-any.whl (112 kB)
  Building wheels for collected packages: cffi
    Building wheel for cffi (setup.py): started
    Building wheel for cffi (setup.py): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /Users/user1/electrum/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/vv/5zc7f2ns7x3dnxrmm01dqm9w0000gn/T/pip-install-crt2d8tu/cffi/setup.py'"'"'; __file__='"'"'/private/var/folders/vv/5zc7f2ns7x3dnxrmm01dqm9w0000gn/T/pip-install-crt2d8tu/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/vv/5zc7f2ns7x3dnxrmm01dqm9w0000gn/T/pip-wheel-3a5oczuy
         cwd: /private/var/folders/vv/5zc7f2ns7x3dnxrmm01dqm9w0000gn/T/pip-install-crt2d8tu/cffi/
    Complete output (39 lines):
    running bdist_wheel
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.14.6-x86_64-3.8
    creating build/lib.macosx-10.14.6-x86_64-3.8/cffi
    copying cffi/backend_ctypes.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
    copying cffi/error.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
    copying cffi/setuptools_ext.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
    copying cffi/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
    copying cffi/cffi_opcode.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
    copying cffi/vengine_gen.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
    copying cffi/pkgconfig.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
    copying cffi/model.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
    copying cffi/ffiplatform.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
    copying cffi/api.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
    copying cffi/vengine_cpy.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
    copying cffi/commontypes.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
    copying cffi/lock.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
    copying cffi/recompiler.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
    copying cffi/cparser.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
    copying cffi/verifier.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
    copying cffi/_cffi_include.h -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
    copying cffi/parse_c_type.h -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
    copying cffi/_embedding.h -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
    copying cffi/_cffi_errors.h -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
    running build_ext
    building '_cffi_backend' extension
    creating build/temp.macosx-10.14.6-x86_64-3.8
    creating build/temp.macosx-10.14.6-x86_64-3.8/c
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -I/usr/local/opt/openssl/include -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi -I/Users/user1/electrum/venv/include -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c c/_cffi_backend.c -o build/temp.macosx-10.14.6-x86_64-3.8/c/_cffi_backend.o
    c/_cffi_backend.c:5854:2: error: Apple Arm64 ABI requires ffi_prep_cif_var
    #error Apple Arm64 ABI requires ffi_prep_cif_var
     ^
    c/_cffi_backend.c:6304:9: error: implicit declaration of function 'ffi_prep_closure' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        if (ffi_prep_closure(closure, &cif_descr->cif,
            ^
    2 errors generated.
    error: command 'clang' failed with exit status 1
    ----------------------------------------
    ERROR: Failed building wheel for cffi
    Running setup.py clean for cffi
  Failed to build cffi
  Installing collected packages: setuptools, wheel, pycparser, cffi
      Running setup.py install for cffi: started
      Running setup.py install for cffi: finished with status 'error'
      ERROR: Command errored out with exit status 1:
       command: /Users/user1/electrum/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/vv/5zc7f2ns7x3dnxrmm01dqm9w0000gn/T/pip-install-crt2d8tu/cffi/setup.py'"'"'; __file__='"'"'/private/var/folders/vv/5zc7f2ns7x3dnxrmm01dqm9w0000gn/T/pip-install-crt2d8tu/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/vv/5zc7f2ns7x3dnxrmm01dqm9w0000gn/T/pip-record-_09codn4/install-record.txt --single-version-externally-managed --prefix /private/var/folders/vv/5zc7f2ns7x3dnxrmm01dqm9w0000gn/T/pip-build-env-70l3p56h/overlay --compile --install-headers /private/var/folders/vv/5zc7f2ns7x3dnxrmm01dqm9w0000gn/T/pip-build-env-70l3p56h/overlay/include/site/python3.8/cffi
           cwd: /private/var/folders/vv/5zc7f2ns7x3dnxrmm01dqm9w0000gn/T/pip-install-crt2d8tu/cffi/
      Complete output (39 lines):
      running install
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.14.6-x86_64-3.8
      creating build/lib.macosx-10.14.6-x86_64-3.8/cffi
      copying cffi/backend_ctypes.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
      copying cffi/error.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
      copying cffi/setuptools_ext.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
      copying cffi/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
      copying cffi/cffi_opcode.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
      copying cffi/vengine_gen.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
      copying cffi/pkgconfig.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
      copying cffi/model.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
      copying cffi/ffiplatform.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
      copying cffi/api.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
      copying cffi/vengine_cpy.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
      copying cffi/commontypes.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
      copying cffi/lock.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
      copying cffi/recompiler.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
      copying cffi/cparser.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
      copying cffi/verifier.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
      copying cffi/_cffi_include.h -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
      copying cffi/parse_c_type.h -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
      copying cffi/_embedding.h -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
      copying cffi/_cffi_errors.h -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.macosx-10.14.6-x86_64-3.8
      creating build/temp.macosx-10.14.6-x86_64-3.8/c
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -I/usr/local/opt/openssl/include -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi -I/Users/user1/electrum/venv/include -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c c/_cffi_backend.c -o build/temp.macosx-10.14.6-x86_64-3.8/c/_cffi_backend.o
      c/_cffi_backend.c:5854:2: error: Apple Arm64 ABI requires ffi_prep_cif_var
      #error Apple Arm64 ABI requires ffi_prep_cif_var
       ^
      c/_cffi_backend.c:6304:9: error: implicit declaration of function 'ffi_prep_closure' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
          if (ffi_prep_closure(closure, &cif_descr->cif,
              ^
      2 errors generated.
      error: command 'clang' failed with exit status 1
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /Users/user1/electrum/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/vv/5zc7f2ns7x3dnxrmm01dqm9w0000gn/T/pip-install-crt2d8tu/cffi/setup.py'"'"'; __file__='"'"'/private/var/folders/vv/5zc7f2ns7x3dnxrmm01dqm9w0000gn/T/pip-install-crt2d8tu/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/vv/5zc7f2ns7x3dnxrmm01dqm9w0000gn/T/pip-record-_09codn4/install-record.txt --single-version-externally-managed --prefix /private/var/folders/vv/5zc7f2ns7x3dnxrmm01dqm9w0000gn/T/pip-build-env-70l3p56h/overlay --compile --install-headers /private/var/folders/vv/5zc7f2ns7x3dnxrmm01dqm9w0000gn/T/pip-build-env-70l3p56h/overlay/include/site/python3.8/cffi Check the logs for full command output.
  ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/user1/electrum/venv/bin/python /Users/user1/electrum/venv/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/vv/5zc7f2ns7x3dnxrmm01dqm9w0000gn/T/pip-build-env-70l3p56h/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.6.0' wheel 'cffi>=1.8,!=1.11.3; platform_python_implementation != '"'"'PyPy'"'"'' Check the logs for full command output.
@foozzi foozzi changed the title error while installing cryptography or cffi error while installing cryptography or cffi on Big Sur Nov 16, 2020
@alex
Copy link
Member

alex commented Nov 16, 2020

Same issue as #5568

@alex alex closed this as completed Nov 16, 2020
@reaperhulk
Copy link
Member

To put this a bit more prominently: pypa/pip#9138 is the bug.

@alex
Copy link
Member

alex commented Nov 30, 2020

There is now pip release which properly handles wheels on Big Sur. Users should upgrade to it.

Folks on M1 macs are still out of luck until CI exists for them.

@alex alex unpinned this issue Nov 30, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants