Error failed building wheel for cffi

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=...
  • 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('"'"'rn'"'"', '"'"'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('"'"'rn'"'"', '"'"'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('"'"'rn'"'"', '"'"'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.

If you are getting Installing build dependencies … error argon2-cffi.

No working compiler found, or bogus compiler options passed to
the compiler from Python’s standard « distutils » module. See
the error messages above. Likely, the problem is not related
to CFFI but generic to the setup.py of any Python package that
tries to compile C code.

Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3.9 /tmp/pip-standalone-pip-h83_ckl5/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-ftq0962g/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.6.0' wheel 'cffi>=1.0'
       cwd: None
  Complete output (136 lines):
  Collecting setuptools>=40.6.0
    Using cached setuptools-56.0.0-py3-none-any.whl (784 kB)
  Collecting wheel
    Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB)
  Collecting cffi>=1.0
    Using cached cffi-1.14.5.tar.gz (475 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: /usr/bin/python3.9 -u -c ....
    Complete output (54 lines):
    cc1: error: unrecognized command line option ‘-Wdate-time’
    cc1: error: unrecognized command line option ‘-fstack-protector-strong’
    cc1: error: unrecognized command line option ‘-fstack-protector-strong’
    cc1: error: unrecognized command line option ‘-Wdate-time’
    cc1: error: unrecognized command line option ‘-fstack-protector-strong’
    cc1: error: unrecognized command line option ‘-fstack-protector-strong’
  
        No working compiler found, or bogus compiler options passed to
        the compiler from Python's standard "distutils" module.  See
        the error messages above.  Likely, the problem is not related
        to CFFI but generic to the setup.py of any Python package that
        tries to compile C code.  (Hints: on OS/X 10.8, for errors about
        -mno-fused-madd see http://stackoverflow.com/questions/22313407/
        Otherwise, see https://wiki.python.org/moin/CompLangPython or
        the IRC channel #python on irc.freenode.net.)
  
        Trying to continue anyway.  If you are trying to install CFFI from
        a build done in a different context, you can ignore this warning.
  
    running bdist_wheel
    running build
    running build_py
    creating build
    creating build/lib.linux-armv7l-3.9
    creating build/lib.linux-armv7l-3.9/cffi
    copying cffi/verifier.py -> build/lib.linux-armv7l-3.9/cffi
    copying cffi/vengine_gen.py -> build/lib.linux-armv7l-3.9/cffi
    copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-3.9/cffi
    copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-3.9/cffi
    copying cffi/recompiler.py -> build/lib.linux-armv7l-3.9/cffi
    copying cffi/pkgconfig.py -> build/lib.linux-armv7l-3.9/cffi
    copying cffi/model.py -> build/lib.linux-armv7l-3.9/cffi
    copying cffi/lock.py -> build/lib.linux-armv7l-3.9/cffi
    copying cffi/ffiplatform.py -> build/lib.linux-armv7l-3.9/cffi
    copying cffi/error.py -> build/lib.linux-armv7l-3.9/cffi
    copying cffi/cparser.py -> build/lib.linux-armv7l-3.9/cffi
    copying cffi/commontypes.py -> build/lib.linux-armv7l-3.9/cffi
    copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-3.9/cffi
    copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-3.9/cffi
    copying cffi/api.py -> build/lib.linux-armv7l-3.9/cffi
    copying cffi/__init__.py -> build/lib.linux-armv7l-3.9/cffi
    copying cffi/_cffi_include.h -> build/lib.linux-armv7l-3.9/cffi
    copying cffi/parse_c_type.h -> build/lib.linux-armv7l-3.9/cffi
    copying cffi/_embedding.h -> build/lib.linux-armv7l-3.9/cffi
    copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-3.9/cffi
    running build_ext
    building '_cffi_backend' extension
    creating build/temp.linux-armv7l-3.9
    creating build/temp.linux-armv7l-3.9/c
    arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.9 -c c/_cffi_backend.c -o build/temp.linux-armv7l-3.9/c/_cffi_backend.o
    cc1: error: unrecognized command line option ‘-Wdate-time’
    cc1: error: unrecognized command line option ‘-fstack-protector-strong’
    cc1: error: unrecognized command line option ‘-fstack-protector-strong’
    error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
    ----------------------------------------
    ERROR: Failed building wheel for cffi
    Running setup.py clean for cffi
  Failed to build cffi
  Installing collected packages: pycparser, wheel, setuptools, 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: .../python3.9/cffi
           cwd: /tmp/pip-install...
      Complete output (54 lines):
      cc1: error: unrecognized command line option ‘-Wdate-time’
      cc1: error: unrecognized command line option ‘-fstack-protector-strong’
      cc1: error: unrecognized command line option ‘-fstack-protector-strong’
      cc1: error: unrecognized command line option ‘-Wdate-time’
      cc1: error: unrecognized command line option ‘-fstack-protector-strong’
      cc1: error: unrecognized command line option ‘-fstack-protector-strong’
  
          No working compiler found, or bogus compiler options passed to
          the compiler from Python's standard "distutils" module.  See
          the error messages above.  Likely, the problem is not related
          to CFFI but generic to the setup.py of any Python package that
          tries to compile C code.  (Hints: on OS/X 10.8, for errors about
          -mno-fused-madd see http://stackoverflow.com/questions/22313407/
          Otherwise, see https://wiki.python.org/moin/CompLangPython or
          the IRC channel #python on irc.freenode.net.)
  
          Trying to continue anyway.  If you are trying to install CFFI from
          a build done in a different context, you can ignore this warning.
  
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-armv7l-3.9
      creating build/lib.linux-armv7l-3.9/cffi
      copying cffi/verifier.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/vengine_gen.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/recompiler.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/pkgconfig.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/model.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/lock.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/ffiplatform.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/error.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/cparser.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/commontypes.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/api.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/__init__.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/_cffi_include.h -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/parse_c_type.h -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/_embedding.h -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-3.9/cffi
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.linux-armv7l-3.9
      creating build/temp.linux-armv7l-3.9/c
      arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.9 -c c/_cffi_backend.c -o build/temp.linux-armv7l-3.9/c/_cffi_backend.o
      cc1: error: unrecognized command line option ‘-Wdate-time’
      cc1: error: unrecognized command line option ‘-fstack-protector-strong’
      cc1: error: unrecognized command line option ‘-fstack-protector-strong’
      error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /usr/bin/python3.9 -u -c 'import io, .../python3.9/cffi Check the logs for full command output.
  ----------------------------------------

Introduction :

No working compiler found, or bogus compiler options passed to the compiler from Python s standard « distutils » module. See the error messages above. Likely, the problem is not related to CFFI but generic to the setup.py of any Python package that tries to compile C code. If you are getting Installing build dependencies … error argon2-cffi. * (GCC 2.2.1) ** A generic ‘package’ module from Python is not expected for most Python packages, so it is no different than using a CFFI and the install module of any Python package. This is probably the most common problem reported. Also of note, a standard ‘install’ module cannot use package definitions. -s <– to generate packages from non-Python software but the Python module may include non-Python Python versions with Python installed. In particular, with the package-version keyword, the `-f’ command can list pre-C compiler files for all major versions of Python, which do not require a build tool. * There are no guarantees about Python 3.1 support for building from source code.

Try to make a package like clang or compilers as safe as possible, as a normal build can crash with a lot more than one error message and even a missing variable type. If Python is able to run, then you might be able to successfully install CFFI on your Windows platform. This works by simply specifying the version of Python that is compiled with it as the command, and passing the compiler option in the module as the argument. In my case, I’m choosing CFFI 4.7.4 with gcc or gcc-4.3 and the argument cffi4. This is actually a compiler I found for CFFI 4.7.1 or 3.3. It has gcc, cpp , and so on. If you’re using Python 3.0.0, it is already compiled with gcc-4.3 as well. That makes the install of the CFFI package more convenient rather than running your project in a distro with CFFI no installed, but with gcc available too and the option of importing CFF

No working compiler found, or bogus compiler options passed to
the compiler from Python's standard "distutils" module. See
the error messages above. Likely, the problem is not related
to CFFI but generic to the setup.py of any Python package that
tries to compile C code.

You have the wrong library type. (I have found that a set of Python libraries have wrong types and are not documented.) In general, installing CFFI and compiling CFPI is quite easy, I just install it as standard and then install them as usual. The second issue with this is that you’re probably installing Python on your system because no CFFI module can tell you what your compiler expects, but it’s not the first time you’ve tried. In general, the best solution is probably to install Python on your system first, with the package’s configuration files. If you have some other Python dependencies, you can get a Python install with « sudo ln -s » to install Python-included packages you would normally expect. On a Mac laptop, your installation path is « cd » and this will show the package directory. After installation, the package can be installed by running « python install » in the terminal to install the correct Python 3.7 or 3.8 package.

Solution :

/usr/bin/python3.9 -m pip install jupyterlab --upgrade

As mentioned, this is going to be more of a pain point because you won’t be happy with gcc. It’s also probably going to cause problems for you when compiling any Python program. For the most part, it is easy for you to compile python source files from C. However, you are really going to need to make a C file. Since C is a long-running command line language, most people probably won’t have the ability to even go as far as importing and parsing C file from python, but still you might find a compileable Python Python code called CFFI. This should be your best bet to get that one. If you know how to build a C-like CFFI file, this is probably the easy part for you since you’ll have to include CFE. It is a program that generates its own compiler (the compiler that generates your code), which is very slow (around 6-7 milliseconds), and has low performance at least on average (under 4 bits of GC or less).

python -m pip install -U cffi pip setuptools
sudo apt install libffi-dev
sudo apt-get install libzbar-dev libzbar0

Liens externes :

https://www.w3schools.com/python/

https://pythonprogramming.net/

https://www.python.org/

Liens internes – les sites web peuvent garder la trace de votre navigation en déposant des sur votre ordinateur. en mode navigation , ces informations sont supprimées à la fermeture du navigateur.

https://128mots.com/index.php/2021/03/16/tri-fusion-python/embed/#?secret=3jjT6bPEJ4 https://128mots.com/index.php/2021/03/16/tri-fusion-python/

ОГЛАВЛЕНИЕ:Cтатья 1 (установка)
Cтатья 2 (базовая настройка)
Cтатья 3 (добавляем устройства)
Cтатья 4 (интеграция с HomeKit)
Статья 5 (автоматизации)
Статья 6 (GUI)Статья 7 (Z-Wave)Статья 8 (MQTT)Статья 9 (HTTPS, SSL)

UPD 28.06.2019

На данный момент я ушел с этого пути и использую установку HA в Docker. Мой готовый образ для Raspberry PI3b/3b можно найти тут. Мой актуальный конфиг HA тут.

Сегодня начнем небольшой (а может быть и большой) курс статей по знакомству с Home Assistant. Это еще одна система управления умным домом, свежая, гибкая кроссплатформенная. Для простоты дальнейшего повествования буду называть его HA. Есть 4 пути заиметь сию систему на своем устройстве. Речь дальне пойдет про малинку, но забегая вперед, могу сказать, что установить его можно практически на любое устройство с Unix-like системой. Итак у нас есть 4 варианта из которых я на данный момент буду говорить об одном.1. Развертывание готового образа Hass.io на флешку2. Установка в виртуальное окружение питона3. Установка в Docker4. Развертывание Raspbian с установленным HA на флешкуЯ для себя выбрал второй вариант как более простой, понятный, а так же дающий более подробные знания о том что мы делаем.Для начала нам нужна малинка с установленной Raspbian. Подойдет любая, даже та которая сейчас используется. Статьи по её установке можно найти например тут и тут. Подключаемся к малинке по ssh и обновляем систему до актуального состояния:

sudo apt-get update
sudo apt-get upgrade -y

После того как процесс удачно завершится, необходимо установить дополнительные пакеты, необходимые для дальнейшей работы:

sudo apt-get install python3 python3-venv python3-pip

Далее добавляем нового пользователя для запуска и работы с HA, с его домашней директорией, где будут храниться конфиги:

sudo useradd -rm homeassistant -G dialout,gpio

Этой же командой мы добавили нового пользователя в группы dialout и gpio для управления интерфейсами самой малины. Далее создадим директорию для установки HA и назначим хозяина директории:

cd /srv
sudo mkdir homeassistant
sudo chown homeassistant:homeassistant homeassistant

После этого создадим виртуальную машину от нашего нового пользователя homeassistant:

sudo -u homeassistant -H -s
cd /srv/homeassistant
python3 -m venv .
source bin/activate
python3 -m pip install wheel

Первоначальные приготовления на этом закончены. можно ставить HA. Проделываем это следующей командой:

pip3 install homeassistant

После ввода команды ждем от 5 до 25 минут в зависимости от скорости вашей флешки, пока все это добро установится. Теперь запускаем наш HA первый раз для создания первоначальных каталогов и конфигов:

Ждем еще минут 10 минимум, пока скачаются необходимые файлы, после этого останавливаем HA комбинацией ctrl c. Выходим из под шелла пользователя homeassistant командой exit. После необходимо создать сервис, который будет запускать HA при перезагрузки малинки. Создадим для этого файл сервиса:

sudo nano /etc/systemd/system/homeassistant@homeassistant.service

Вставляем в него следующий текст и сохраняем файл:

[Unit]
Description=Home Assistant
After=network-online.target

[Service]
Type=simple
User=%i
ExecStart=/srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant"

[Install]
WantedBy=multi-user.target

Далее надо активировать наш сервис в системе и запустить его:

sudo systemctl --system daemon-reload
sudo systemctl enable homeassistant@homeassistant.service
sudo systemctl start homeassistant@homeassistant.service

Если вы все сделали правильно, через небольшой промежуток времени вы сможете увидеть свой свежеустановленный в браузере. Для этого необходимо перейти по ссылке http://ip.малинки:8123 и откроется что-то похожее на это:

Как видите это долго, но совсем не сложно! В дальнейшем для обновления HA необходимо подключиться к малине по ssh и выполнить следующие три команды:

sudo -u homeassistant -H -s
source /srv/homeassistant/bin/activate
pip3 install --upgrade homeassistant

На этом мы заканчиваем первоначальную установку и настройку и увидимся с вами в следующих статьях!

Понравилась статья? Поделить с друзьями:
  • Error failed building wheel for aiohttp
  • Error failed attempt to launch program or document action mass effect
  • Error failed at splitting arguments either an unbalanced jinja2 block or quotes
  • Error fail to update the uploaded file was not accepted by the router
  • Error failed data transfer failure too many links