Building wheel for cffi setup py finished with status error

I am trying to install a new Django project from git, I created a new virtual envt using python3(version: 3.8.5). When I try to install the required libraries in the requirements.txt, I get the fol...

I am trying to install a new Django project from git, I created a new virtual envt using
python3(version: 3.8.5). When I try to install the required libraries in the requirements.txt, I get the following errors for cffi==1.11.5 package.

Building wheels for collected packages: cffi
  Building wheel for cffi (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/jessica/Documents/FreelanceProjects/crowdbuy/env/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-71z3f0vy/cffi_136411f3ae2d49e4b889de52edc8d550/setup.py'"'"'; __file__='"'"'/tmp/pip-install-71z3f0vy/cffi_136411f3ae2d49e4b889de52edc8d550/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-1y2in5qm
       cwd: /tmp/pip-install-71z3f0vy/cffi_136411f3ae2d49e4b889de52edc8d550/
  Complete output (49 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/cffi
  copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/model.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/cparser.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/verifier.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/__init__.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/commontypes.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/lock.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/api.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/recompiler.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/error.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/_embedding.h -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.8/cffi
  running build_ext
  building '_cffi_backend' extension
  creating build/temp.linux-x86_64-3.8
  creating build/temp.linux-x86_64-3.8/c
  x86_64-linux-gnu-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 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/home/jessica/Documents/FreelanceProjects/crowdbuy/env/include -I/usr/include/python3.8 -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.8/c/_cffi_backend.o
  c/_cffi_backend.c: In function ‘b_do_dlopen’:
  c/_cffi_backend.c:4197:31: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   4197 |         *p_printable_filename = PyText_AsUTF8(s);
        |                               ^
  c/_cffi_backend.c: In function ‘b_callback’:
  c/_cffi_backend.c:5911:5: warning: ‘ffi_prep_closure’ is deprecated: use ffi_prep_closure_loc instead [-Wdeprecated-declarations]
   5911 |     if (ffi_prep_closure(closure, &cif_descr->cif,
        |     ^~
  In file included from c/_cffi_backend.c:15:
  /usr/include/x86_64-linux-gnu/ffi.h:334:1: note: declared here
    334 | ffi_prep_closure (ffi_closure*,
        | ^~~~~~~~~~~~~~~~
  In file included from c/cffi1_module.c:20,
                   from c/_cffi_backend.c:7370:
  c/call_python.c: In function ‘_get_interpstate_dict’:
  c/call_python.c:20:30: error: dereferencing pointer to incomplete type ‘PyInterpreterState’ {aka ‘struct _is’}
     20 |     builtins = tstate->interp->builtins;
        |                              ^~
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for cffi
  Running setup.py clean for cffi
Failed to build cffi
Installing collected packages: pycparser, urllib3, six, pytz, jdcal, idna, et-xmlfile, chardet, cffi, certifi, asn1crypto, xlwt, xlrd, unicodecsv, text-unidecode, requests, PyYAML, python-dateutil, openpyxl, odfpy, oauthlib, Django, defusedxml, cryptography, tablib, sqlparse, requests-oauthlib, python3-openid, pyOpenSSL, Pillow, phonenumberslite, pbr, Faker, django-ranged-response, django-js-asset, diff-match-patch, Babel, Unidecode, sorl-thumbnail, PyMySQL, purl, paypalrestsdk, mock, future, factory-boy, django-widget-tweaks, django-treebeard, django-tables2, django-simple-captcha, django-phonenumber-field, django-paypal, django-mptt, django-modeltranslation, django-import-export, django-haystack, django-filter, django-extra-views, django-debug-toolbar, django-crontab, django-countries, django-anymail, django-allauth, django-admin-honeypot
    Running setup.py install for cffi ... error
    ERROR: Command errored out with exit status 1:
     command: /home/jessica/Documents/FreelanceProjects/crowdbuy/env/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-71z3f0vy/cffi_136411f3ae2d49e4b889de52edc8d550/setup.py'"'"'; __file__='"'"'/tmp/pip-install-71z3f0vy/cffi_136411f3ae2d49e4b889de52edc8d550/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-yjyoqxw6/install-record.txt --single-version-externally-managed --compile --install-headers /home/jessica/Documents/FreelanceProjects/crowdbuy/env/include/site/python3.8/cffi
         cwd: /tmp/pip-install-71z3f0vy/cffi_136411f3ae2d49e4b889de52edc8d550/
    Complete output (49 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/cffi
    copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/model.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/cparser.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/verifier.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/__init__.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/commontypes.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/lock.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/api.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/recompiler.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/error.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/_embedding.h -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.8/cffi
    running build_ext
    building '_cffi_backend' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/c
    x86_64-linux-gnu-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 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/home/jessica/Documents/FreelanceProjects/crowdbuy/env/include -I/usr/include/python3.8 -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.8/c/_cffi_backend.o
    c/_cffi_backend.c: In function ‘b_do_dlopen’:
    c/_cffi_backend.c:4197:31: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
     4197 |         *p_printable_filename = PyText_AsUTF8(s);
          |                               ^
    c/_cffi_backend.c: In function ‘b_callback’:
    c/_cffi_backend.c:5911:5: warning: ‘ffi_prep_closure’ is deprecated: use ffi_prep_closure_loc instead [-Wdeprecated-declarations]
     5911 |     if (ffi_prep_closure(closure, &cif_descr->cif,
          |     ^~
    In file included from c/_cffi_backend.c:15:
    /usr/include/x86_64-linux-gnu/ffi.h:334:1: note: declared here
      334 | ffi_prep_closure (ffi_closure*,
          | ^~~~~~~~~~~~~~~~
    In file included from c/cffi1_module.c:20,
                     from c/_cffi_backend.c:7370:
    c/call_python.c: In function ‘_get_interpstate_dict’:
    c/call_python.c:20:30: error: dereferencing pointer to incomplete type ‘PyInterpreterState’ {aka ‘struct _is’}
       20 |     builtins = tstate->interp->builtins;
          |                              ^~
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/jessica/Documents/FreelanceProjects/crowdbuy/env/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-71z3f0vy/cffi_136411f3ae2d49e4b889de52edc8d550/setup.py'"'"'; __file__='"'"'/tmp/pip-install-71z3f0vy/cffi_136411f3ae2d49e4b889de52edc8d550/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-yjyoqxw6/install-record.txt --single-version-externally-managed --compile --install-headers /home/jessica/Documents/FreelanceProjects/crowdbuy/env/include/site/python3.8/cffi Check the logs for full command output.

I will also add my requirements.txt file.

asn1crypto==0.24.0
Babel==2.5.3
certifi==2018.1.18
cffi==1.11.5
chardet==3.0.4
cryptography==2.2.2
defusedxml==0.5.0
diff-match-patch==20121119
Django==2.0.4
django-admin-honeypot==1.1.0
django-allauth==0.35.0
django-anymail==2.0
django-countries==5.3
django-debug-toolbar==1.9.1
django-extra-views==0.6.4
django-filter==1.1.0
django-haystack==2.8.1
django-import-export==1.0.1
django-js-asset==1.0.0
django-modeltranslation==0.12.2
django-mptt==0.9.0
django-paypal==0.5.0
django-phonenumber-field==1.3.0
django-ranged-response==0.2.0
django-simple-captcha==0.5.6
django-tables2==1.16.0
django-treebeard==4.3
django-widget-tweaks==1.4.2
et-xmlfile==1.0.1
factory-boy==2.10.0
Faker==0.8.13
future==0.16.0
idna==2.6
jdcal==1.4
mock==2.0.0
oauthlib==2.0.7
odfpy==1.3.6
openpyxl==2.5.4
paypalrestsdk==1.13.1
pbr==4.0.2
phonenumberslite==8.9.3
Pillow==5.1.0
purl==1.4
pycparser==2.18
PyMySQL==0.8.0
pyOpenSSL==17.5.0
python-dateutil==2.7.2
python3-openid==3.1.0
pytz==2018.4
PyYAML==3.12
requests==2.18.4
requests-oauthlib==0.8.0
six==1.11.0
sorl-thumbnail==12.4.1
sqlparse==0.2.4
tablib==0.12.1
text-unidecode==1.2
unicodecsv==0.14.1
Unidecode==0.4.21
urllib3==1.22
xlrd==1.1.0
xlwt==1.3.0
django-crontab

I have already followed some suggestions on stackoverflow but that doesn’t seem to work.
The things that I have tried already.
Failed to install Python Cryptography package with PIP and setup.py

sudo apt-get install build-essential libssl-dev libffi-dev python3-dev

I am using Ubuntu. Please let me know what I am doing wrong.

I just tried to use nogil on my side project, and found out there is an error when installing cffi. Seems like there is a confict between nogil and CPython.

Origin error message as following,

Installing cffi (1.15.0): Failed

  EnvCommandError

  Command ['/workspace/.venv/bin/pip', 'install', '--no-deps', 'file:///root/.cache/pypoetry/artifacts/20/b6/2f/d86d84b144949a7c7435d77e30e4731b66f07f492faac0f75b18bebca7/cffi-1.15.0.tar.gz'] errored with the following return code 1, and output: 
  Processing /root/.cache/pypoetry/artifacts/20/b6/2f/d86d84b144949a7c7435d77e30e4731b66f07f492faac0f75b18bebca7/cffi-1.15.0.tar.gz
  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: /workspace/.venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-ned2bb9p/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-ned2bb9p/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-fies3lsc
         cwd: /tmp/pip-req-build-ned2bb9p/
    Complete output (36 lines):
    running bdist_wheel
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.9
    creating build/lib.linux-x86_64-3.9/cffi
    copying cffi/commontypes.py -> build/lib.linux-x86_64-3.9/cffi
    copying cffi/cparser.py -> build/lib.linux-x86_64-3.9/cffi
    copying cffi/model.py -> build/lib.linux-x86_64-3.9/cffi
    copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.9/cffi
    copying cffi/recompiler.py -> build/lib.linux-x86_64-3.9/cffi
    copying cffi/pkgconfig.py -> build/lib.linux-x86_64-3.9/cffi
    copying cffi/api.py -> build/lib.linux-x86_64-3.9/cffi
    copying cffi/verifier.py -> build/lib.linux-x86_64-3.9/cffi
    copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.9/cffi
    copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.9/cffi
    copying cffi/__init__.py -> build/lib.linux-x86_64-3.9/cffi
    copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.9/cffi
    copying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.9/cffi
    copying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.9/cffi
    copying cffi/lock.py -> build/lib.linux-x86_64-3.9/cffi
    copying cffi/error.py -> build/lib.linux-x86_64-3.9/cffi
    copying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.9/cffi
    copying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.9/cffi
    copying cffi/_embedding.h -> build/lib.linux-x86_64-3.9/cffi
    copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.9/cffi
    running build_ext
    building '_cffi_backend' extension
    creating build/temp.linux-x86_64-3.9
    creating build/temp.linux-x86_64-3.9/c
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/workspace/.venv/include -I/usr/local/include/python3.9 -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.9/c/_cffi_backend.o
    c/_cffi_backend.c: In function ‘get_unique_type’:
    c/_cffi_backend.c:4638:20: error: ‘PyObject’ {aka ‘struct _object’} has no member named ‘ob_refcnt’
     4638 |     ((PyObject *)x)->ob_refcnt--;
          |                    ^~
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
    ERROR: Failed building wheel for cffi
    Running setup.py clean for cffi
  Failed to build cffi
  Installing collected packages: 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: /workspace/.venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-ned2bb9p/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-ned2bb9p/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-e26e6dwz/install-record.txt --single-version-externally-managed --compile --install-headers /workspace/.venv/include/site/python3.9/cffi
           cwd: /tmp/pip-req-build-ned2bb9p/
      Complete output (36 lines):
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.9
      creating build/lib.linux-x86_64-3.9/cffi
      copying cffi/commontypes.py -> build/lib.linux-x86_64-3.9/cffi
      copying cffi/cparser.py -> build/lib.linux-x86_64-3.9/cffi
      copying cffi/model.py -> build/lib.linux-x86_64-3.9/cffi
      copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.9/cffi
      copying cffi/recompiler.py -> build/lib.linux-x86_64-3.9/cffi
      copying cffi/pkgconfig.py -> build/lib.linux-x86_64-3.9/cffi
      copying cffi/api.py -> build/lib.linux-x86_64-3.9/cffi
      copying cffi/verifier.py -> build/lib.linux-x86_64-3.9/cffi
      copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.9/cffi
      copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.9/cffi
      copying cffi/__init__.py -> build/lib.linux-x86_64-3.9/cffi
      copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.9/cffi
      copying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.9/cffi
      copying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.9/cffi
      copying cffi/lock.py -> build/lib.linux-x86_64-3.9/cffi
      copying cffi/error.py -> build/lib.linux-x86_64-3.9/cffi
      copying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.9/cffi
      copying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.9/cffi
      copying cffi/_embedding.h -> build/lib.linux-x86_64-3.9/cffi
      copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.9/cffi
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.linux-x86_64-3.9
      creating build/temp.linux-x86_64-3.9/c
      gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/workspace/.venv/include -I/usr/local/include/python3.9 -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.9/c/_cffi_backend.o
      c/_cffi_backend.c: In function ‘get_unique_type’:
      c/_cffi_backend.c:4638:20: error: ‘PyObject’ {aka ‘struct _object’} has no member named ‘ob_refcnt’
       4638 |     ((PyObject *)x)->ob_refcnt--;
            |                    ^~
      error: command 'gcc' failed with exit status 1
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /workspace/.venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-ned2bb9p/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-ned2bb9p/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-e26e6dwz/install-record.txt --single-version-externally-managed --compile --install-headers /workspace/.venv/include/site/python3.9/cffi Check the logs for full command output.
  WARNING: You are using pip version 21.2.4; however, version 21.3 is available.
  You should consider upgrading via the '/workspace/.venv/bin/python -m pip install --upgrade pip' command.
  

  at /usr/local/lib/python3.9/site-packages/poetry/utils/env.py:1183 in _run
      1179│                 output = subprocess.check_output(
      1180│                     cmd, stderr=subprocess.STDOUT, **kwargs
      1181│                 )
      1182│         except CalledProcessError as e:
    → 1183│             raise EnvCommandError(e, input=input_)
      1184│ 
      1185│         return decode(output)
      1186│ 
      1187│     def execute(self, bin, *args, **kwargs):

The OS running on the Pi is Raspbian 9.8, I’m trying to do the

sudo pip install --pre azure 

So I can send images from my Pi to my blob storage on azure but when I run the above command it begins to install fine until it gets to the ffi.h part and then in red writing it says «Failed building wheel for cffi» as shown in the code.

pi@raspberrypi:~ $ sudo pip install --pre azure

Part of the output is

    building '_cffi_backend' extension
    creating build/temp.linux-armv7l-2.7
    creating build/temp.linux-armv7l-2.7/c
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-
    prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -
    fdebug-prefix-map=/build/python2.7-Ub3vap/python2.7-2.7.13=. -fstack-
    protector-strong -Wformat -Werror=format-security -fPIC -DUSE__THREAD -
    DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-armv7l-2.7/c/_cffi_backend.o
  c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
   #include <ffi.h>
                   ^
  compilation terminated.
  error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for cffi
  Running setup.py clean for cffi
Failed to build cffi
Installing collected packages: cffi, scandir, pathlib2, azure-datalake-store, azure-servicebus, azure-storage-queue, azure-mgmt-nspkg, azure-mgmt-keyvault, azure-mgmt-logic, azure-mgmt-subscription, azure-mgmt-redis, azure-mgmt-containerservice, azure-mgmt-datalake-nspkg, azure-mgmt-datalake-analytics, azure-mgmt-loganalytics, azure-mgmt-hanaonazure, azure-mgmt-devspaces, azure-mgmt-maps, azure-mgmt-recoveryservicesbackup, azure-mgmt-applicationinsights, azure-mgmt-scheduler, azure-mgmt-network, azure-mgmt-devtestlabs, azure-mgmt-eventhub, azure-mgmt-reservations, azure-mgmt-servicebus, azure-mgmt-notificationhubs, azure-mgmt-eventgrid, azure-mgmt-iotcentral, azure-mgmt-billing, azure-mgmt-datafactory, azure-mgmt-commerce, azure-mgmt-storage, azure-mgmt-resource, azure-mgmt-iothubprovisioningservices, azure-mgmt-batchai, azure-mgmt-trafficmanager, azure-mgmt-marketplaceordering, azure-mgmt-machinelearningcompute, azure-mgmt-managementgroups, azure-mgmt-monitor, azure-mgmt-powerbiembedded, azure-mgmt-msi, azure-mgmt-cognitiveservices, azure-mgmt-compute, azure-mgmt-search, azure-mgmt-advisor, azure-mgmt-managementpartner, azure-mgmt-consumption, azure-mgmt-datalake-store, azure-mgmt-media, azure-mgmt-batch, azure-mgmt-containerregistry, azure-mgmt-cdn, azure-mgmt-containerinstance, azure-mgmt-relay, azure-mgmt-dns, azure-mgmt-signalr, azure-mgmt-policyinsights, azure-mgmt-authorization, azure-mgmt-rdbms, azure-mgmt-servicefabric, azure-mgmt-sql, azure-mgmt-web, azure-mgmt-cosmosdb, azure-mgmt-iothub, azure-mgmt-recoveryservices, azure-mgmt-datamigration, azure-mgmt, azure-applicationinsights, azure-keyvault, azure-storage-blob, azure-batch, azure
  Running setup.py install for cffi ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-tNlbDT/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-BKywpl-record/install-record.txt --single-version-externally-managed --compile:
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-armv7l-2.7
    creating build/lib.linux-armv7l-2.7/cffi
    copying cffi/cparser.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/commontypes.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/lock.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/recompiler.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/error.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/pkgconfig.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/ffiplatform.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/vengine_gen.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/model.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/verifier.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/api.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/__init__.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/_cffi_include.h -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/parse_c_type.h -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/_embedding.h -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-2.7/cffi
    running build_ext
    building '_cffi_backend' extension
    creating build/temp.linux-armv7l-2.7
    creating build/temp.linux-armv7l-2.7/c
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-Ub3vap/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-armv7l-2.7/c/_cffi_backend.o
    c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
     #include <ffi.h>
                     ^
    compilation terminated.
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-tNlbDT/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-BKywpl-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-tNlbDT/cffi/

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/

Issue

I got the following error while building a docker image by «docker-compose build».

ERROR: Couldn't connect to Docker daemon at http://127.0.0.1:2375 - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

Even if I try with «sudo», I got this:

Building web
Step 1/8 : FROM python:3.8.3-alpine
 ---> 8ecf5a48c789
Step 2/8 : WORKDIR /usr/src/app
 ---> Using cache
 ---> 87bb0088a0ba
Step 3/8 : ENV PYTHONDONTWRITEBYTECODE 1
 ---> Using cache
 ---> 4f1a6ddf9e1f
Step 4/8 : ENV PYTHONUNBUFFERED 1
 ---> Using cache
 ---> 5d22b6b7a0f5
Step 5/8 : RUN pip install --upgrade pip
 ---> Using cache
 ---> 169ee831f728
Step 6/8 : COPY ./requirements.txt .
 ---> Using cache
 ---> 4b4351e31632
Step 7/8 : RUN pip install -r requirements.txt
 ---> Running in a4dae2fe3761
Collecting asgiref==3.2.10
  Downloading asgiref-3.2.10-py3-none-any.whl (19 kB)
Collecting cffi==1.14.3
  Downloading cffi-1.14.3.tar.gz (470 kB)
Collecting cryptography==3.2.1
  Downloading cryptography-3.2.1.tar.gz (540 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python /usr/local/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-p3ocmpkd/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 (128 lines):
  Collecting setuptools>=40.6.0
    Downloading setuptools-50.3.2-py3-none-any.whl (785 kB)
  Collecting wheel
    Downloading 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
    Downloading 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/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_eoslhz1/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_eoslhz1/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 /tmp/pip-wheel-99ngzpxw
         cwd: /tmp/pip-install-_eoslhz1/cffi/
    Complete output (50 lines):
    unable to execute 'gcc': No such file or directory
    unable to execute 'gcc': No such file or directory
  
        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-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/cffi
    copying cffi/api.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/verifier.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/recompiler.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/model.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/__init__.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/error.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/cparser.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/commontypes.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/pkgconfig.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/lock.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/_embedding.h -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.8/cffi
    warning: build_py: byte-compiling is disabled, skipping.
  
    running build_ext
    building '_cffi_backend' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/c
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/ffi -I/usr/include/libffi -I/usr/local/include/python3.8 -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.8/c/_cffi_backend.o
    unable to execute 'gcc': No such file or directory
    error: command 'gcc' 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: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_eoslhz1/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_eoslhz1/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-pah2aui6/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-p3ocmpkd/overlay --compile --install-headers /tmp/pip-build-env-p3ocmpkd/overlay/include/python3.8/cffi
           cwd: /tmp/pip-install-_eoslhz1/cffi/
      Complete output (50 lines):
      unable to execute 'gcc': No such file or directory
      unable to execute 'gcc': No such file or directory
  
          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-x86_64-3.8
      creating build/lib.linux-x86_64-3.8/cffi
      copying cffi/api.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/verifier.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/recompiler.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/model.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/__init__.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/error.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/cparser.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/commontypes.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/pkgconfig.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/lock.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/_embedding.h -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.8/cffi
      warning: build_py: byte-compiling is disabled, skipping.
  
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.linux-x86_64-3.8
      creating build/temp.linux-x86_64-3.8/c
      gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/ffi -I/usr/include/libffi -I/usr/local/include/python3.8 -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.8/c/_cffi_backend.o
      unable to execute 'gcc': No such file or directory
      error: command 'gcc' failed with exit status 1
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_eoslhz1/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_eoslhz1/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-pah2aui6/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-p3ocmpkd/overlay --compile --install-headers /tmp/pip-build-env-p3ocmpkd/overlay/include/python3.8/cffi Check the logs for full command output.
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python /usr/local/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-p3ocmpkd/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.
ERROR: Service 'web' failed to build: The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1

That is my Dockerfile:

# pull official base image
FROM python:3.8.3-alpine

# set work directory
WORKDIR /usr/src/app

# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# install dependencies
RUN pip install --upgrade pip
COPY ./requirements.txt .
RUN pip install -r requirements.txt

# copy project
COPY . .

and docker-compose.yml:

version: '3.7'

services:
  web:
    build: .
    command: python manage.py runserver 0.0.0.0:8000
    volumes:
      - ./:/usr/src/app/
    ports:
      - 8000:8000
    env_file:
      - ./.env.dev

I will add that I bought my laptop a few months ago, and already had problems with Docker on my previous system on this device (that’s one of the reasons I changed my system). I switched from Fedora to Ubuntu.

Additionally, there is no «python» alias for python3 in my shell, and because of the unknown reason I need to put «python3 -m» before simple «pip freeze».

I hope that information may be useful.
Thank You.

.
.
.

After adding a «RUN apk add builder-base» in my Dockerfile, following error appears:

Step 8/9 : RUN pip install -r requirements.txt
 ---> Running in cd9c74fbd831
Collecting asgiref==3.2.10
  Downloading asgiref-3.2.10-py3-none-any.whl (19 kB)
Collecting cffi==1.14.3
  Downloading cffi-1.14.3.tar.gz (470 kB)
Collecting cryptography==3.2.1
  Downloading cryptography-3.2.1.tar.gz (540 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python /usr/local/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-gbfaltlj/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 (104 lines):
  Collecting setuptools>=40.6.0
    Downloading setuptools-50.3.2-py3-none-any.whl (785 kB)
  Collecting wheel
    Downloading 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
    Downloading 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/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-myhajkmm/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-myhajkmm/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 /tmp/pip-wheel-9jsg5veu
         cwd: /tmp/pip-install-myhajkmm/cffi/
    Complete output (38 lines):
    running bdist_wheel
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/cffi
    copying cffi/api.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/verifier.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/recompiler.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/model.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/__init__.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/error.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/cparser.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/commontypes.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/pkgconfig.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/lock.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/_embedding.h -> build/lib.linux-x86_64-3.8/cffi
    copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.8/cffi
    warning: build_py: byte-compiling is disabled, skipping.
  
    running build_ext
    building '_cffi_backend' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/c
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/local/include/python3.8 -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.8/c/_cffi_backend.o
    c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
       15 | #include <ffi.h>
          |          ^~~~~~~
    compilation terminated.
    error: command 'gcc' 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: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-myhajkmm/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-myhajkmm/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-s86a1yn7/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-gbfaltlj/overlay --compile --install-headers /tmp/pip-build-env-gbfaltlj/overlay/include/python3.8/cffi
           cwd: /tmp/pip-install-myhajkmm/cffi/
      Complete output (38 lines):
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.8
      creating build/lib.linux-x86_64-3.8/cffi
      copying cffi/api.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/verifier.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/recompiler.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/model.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/__init__.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/error.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/cparser.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/commontypes.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/pkgconfig.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/lock.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/_embedding.h -> build/lib.linux-x86_64-3.8/cffi
      copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.8/cffi
      warning: build_py: byte-compiling is disabled, skipping.
  
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.linux-x86_64-3.8
      creating build/temp.linux-x86_64-3.8/c
      gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/local/include/python3.8 -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.8/c/_cffi_backend.o
      c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
         15 | #include <ffi.h>
            |          ^~~~~~~
      compilation terminated.
      error: command 'gcc' failed with exit status 1
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-myhajkmm/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-myhajkmm/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-s86a1yn7/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-gbfaltlj/overlay --compile --install-headers /tmp/pip-build-env-gbfaltlj/overlay/include/python3.8/cffi Check the logs for full command output.
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python /usr/local/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-gbfaltlj/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.
ERROR: Service 'web' failed to build: The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1

Solution

Alpine Linux does not support the binary wheels Python packages ship under the manylinux tag, so you have to compile things like cffi and cryptography yourself. To do so you’ll need a compiler and the correct set of headers. This is documented in the cryptography installation documentation for Alpine.

Update September 2021: There is now a musllinux standard which allows binary wheels that work with Alpine. To use them you must have pip 21.2.4 or greater.

Answered By — Paul Kehrer

I am trying to build a docker image. I have a install.sh file which will run when it is built. The contents of install.sh is as follows

sudo apt-get install -y python-dev python3.5 python3.5-dev
# Install virtualenv
sudo wget https://bootstrap.pypa.io/ez_setup.py -O /tmp/ez_setup.py
sudo python3.5 /tmp/ez_setup.py
sudo easy_install-3.5 pip
pip3.5 install virtualenv
#pip install -U cffi
virtualenv -p python3.5 $HOME/venv/3.5
# Install pip packages
. $HOME/venv/3.5/bin/activate
pip install pyopenssl ndg-httpsclient pyasn1
pip install nose mock pytest coverage
CFLAGS="-O0" pip install lxml
deactivate

When pip install pyopenssl ndg-httpsclient pyasn1 is executed, I recieve the following error

running install_egg_info
Copying src/cryptography.egg-info to build/bdist.linux-x86_64/wheel/cryptography-1.1.1-py3.5.egg-info
running install_scripts
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-ytr1o8ux/cryptography/setup.py", line 318, in <module>
**keywords_with_side_effects(sys.argv)
File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/root/venv/3.5/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 213, in run
archive_basename = self.get_archive_basename()
File "/root/venv/3.5/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 161, in get_archive_basename
impl_tag, abi_tag, plat_tag = self.get_tag()
File "/root/venv/3.5/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 155, in get_tag
assert tag == supported_tags[0]
AssertionError

----------------------------------------
Running setup.py bdist_wheel for cffi
Failed building wheel for cryptography

After looking at this link, I tried to use updated wheels package

wget http://nipy.bic.berkeley.edu/scipy_installers/wheel-0.24.0-py2.py3-none-any.whl
pip install wheel-0.24.0-py2.py3-non-any.whl

Still the same error. Inspite of this error, the image is successfully built. Any help will be appreciated.

Thanks in advance.

Not sure if I’m at the right place but I’m trying to install conan package (C++ dependency manager) which depends on cryptography and cffi.
When trying to install on my Intel iMac running macOS 11 (Big Sur) and Xcode 12.2 I get this error. What can I do?

fallen@Fallens-iMac ~ % sudo pip3 install cryptography
Password:
WARNING: The directory '/Users/fallen/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting cryptography
  Downloading cryptography-3.2.1.tar.gz (540 kB)
     |████████████████████████████████| 540 kB 3.3 MB/s 
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 /Library/Python/3.8/site-packages/pip install --ignore-installed --no-user --prefix /private/tmp/pip-build-env-krwjs7pn/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 (107 lines):
  WARNING: The directory '/Users/fallen/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
  Collecting setuptools>=40.6.0
    Downloading setuptools-50.3.2-py3-none-any.whl (785 kB)
  Collecting wheel
    Downloading wheel-0.35.1-py2.py3-none-any.whl (33 kB)
  Collecting cffi!=1.11.3,>=1.8
    Downloading cffi-1.14.3.tar.gz (470 kB)
  Collecting pycparser
    Downloading 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: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-ktsozvj1/cffi/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-ktsozvj1/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/tmp/pip-wheel-iqjbsomf
         cwd: /private/tmp/pip-install-ktsozvj1/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 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi -I/Applications/Xcode.app/Contents/Developer/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: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-ktsozvj1/cffi/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-ktsozvj1/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/tmp/pip-record-olwxnt0f/install-record.txt --single-version-externally-managed --prefix /private/tmp/pip-build-env-krwjs7pn/overlay --compile --install-headers /private/tmp/pip-build-env-krwjs7pn/overlay/include/python3.8/cffi
           cwd: /private/tmp/pip-install-ktsozvj1/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 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi -I/Applications/Xcode.app/Contents/Developer/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: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-ktsozvj1/cffi/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-ktsozvj1/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/tmp/pip-record-olwxnt0f/install-record.txt --single-version-externally-managed --prefix /private/tmp/pip-build-env-krwjs7pn/overlay --compile --install-headers /private/tmp/pip-build-env-krwjs7pn/overlay/include/python3.8/cffi Check the logs for full command output.
  ----------------------------------------
ERROR: Command errored out with exit status 1: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 /Library/Python/3.8/site-packages/pip install --ignore-installed --no-user --prefix /private/tmp/pip-build-env-krwjs7pn/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.

(Issue has been solved) Hi there So I the other day I came across this github repo LINK HERE, and tried to set it up but I get this error:

ERROR: Command errored out with exit status 1: command: /usr/local/bin/python /usr/local/lib/python3.6/site-packages/pip install —ignore-installed —no-user —prefix /tmp/pip-build-env-9o6ad2nw/overlay —no-warn-script-location —no-binary :none: —only-binary :none: -i https://pypi.org/simple — ‘setuptools >= 40.8.0’ wheel ‘Cython >= 3.0a5’ ‘cffi >= 1.12.3 ; platform_python_implementation == ‘»‘»‘CPython'»‘»» ‘greenlet >= 0.4.16 ; platform_python_implementation == ‘»‘»‘CPython'»‘»» cwd: None Complete output (109 lines): Collecting setuptools>=40.8.0 Downloading setuptools-49.2.0-py3-none-any.whl (789 kB) Collecting wheel Downloading wheel-0.34.2-py2.py3-none-any.whl (26 kB) Collecting Cython>=3.0a5 Downloading Cython-3.0a5-py2.py3-none-any.whl (1.0 MB) Collecting cffi>=1.12.3 Downloading cffi-1.14.0.tar.gz (463 kB) Collecting greenlet>=0.4.16 Downloading greenlet-0.4.16.tar.gz (60 kB) Collecting pycparser Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB) Building wheels for collected packages: cffi, greenlet 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/local/bin/python -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘/tmp/pip-install-9_mcfbp1/cffi/setup.py'»‘»‘; __file__='»‘»‘/tmp/pip-install-9_mcfbp1/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 /tmp/pip-wheel-kbwh8jy8 cwd: /tmp/pip-install-9_mcfbp1/cffi/ Complete output (36 lines): running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.6 creating build/lib.linux-x86_64-3.6/cffi copying cffi/commontypes.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/pkgconfig.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/recompiler.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/lock.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/init.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/cparser.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/api.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/verifier.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/error.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/model.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.6/cffi copying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.6/cffi copying cffi/_embedding.h -> build/lib.linux-x86_64-3.6/cffi copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.6/cffi running build_ext building ‘_cffi_backend’ extension creating build/temp.linux-x86_64-3.6 creating build/temp.linux-x86_64-3.6/c gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/local/include/python3.6m -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.6/c/_cffi_backend.o c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory 15 | #include <ffi.h> | ~~~~~~ compilation terminated. error: command ‘gcc’ failed with exit status 1 —————————————- ERROR: Failed building wheel for cffi Running setup.py clean for cffi Building wheel for greenlet (setup.py): started Building wheel for greenlet (setup.py): finished with status ‘done’ Created wheel for greenlet: filename=greenlet-0.4.16-cp36-cp36m-linux_x86_64.whl size=18070 sha256=cc45ce821b6b6401799f8b20a36f573188708177399829a0ad399cd33511e845 Stored in directory: /root/.cache/pip/wheels/7f/3a/c8/c1972109e5f45e7c151afa67d3c5a07e0a0dd592345ac12c73 Successfully built greenlet Failed to build cffi Installing collected packages: setuptools, wheel, Cython, pycparser, cffi, greenlet 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: /usr/local/bin/python -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘/tmp/pip-install-9_mcfbp1/cffi/setup.py'»‘»‘; __file__='»‘»‘/tmp/pip-install-9_mcfbp1/cffi/setup.py'»‘»‘;f=getattr(tokenize, ‘»‘»‘open'»‘»‘, open)(file);code=f.read().replace(‘»‘»‘rn'»‘»‘, ‘»‘»‘n'»‘»‘);f.close();exec(compile(code, file, ‘»‘»‘exec'»‘»‘))’ install —record /tmp/pip-record-kr24lkic/install-record.txt —single-version-externally-managed —prefix /tmp/pip-build-env-9o6ad2nw/overlay —compile —install-headers /tmp/pip-build-env-9o6ad2nw/overlay/include/python3.6m/cffi cwd: /tmp/pip-install-9_mcfbp1/cffi/ Complete output (36 lines): running install running build running build_py creating build creating build/lib.linux-x86_64-3.6 creating build/lib.linux-x86_64-3.6/cffi copying cffi/commontypes.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/pkgconfig.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/recompiler.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/lock.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/init.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/cparser.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/api.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/verifier.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/error.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/model.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.6/cffi copying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.6/cffi copying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.6/cffi copying cffi/_embedding.h -> build/lib.linux-x86_64-3.6/cffi copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.6/cffi running build_ext building ‘_cffi_backend’ extension creating build/temp.linux-x86_64-3.6 creating build/temp.linux-x86_64-3.6/c gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/local/include/python3.6m -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.6/c/_cffi_backend.o c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory 15 | #include <ffi.h> | ~~~~~~ compilation terminated. error: command ‘gcc’ failed with exit status 1 —————————————- ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘/tmp/pip-install-9_mcfbp1/cffi/setup.py'»‘»‘; __file__='»‘»‘/tmp/pip-install-9_mcfbp1/cffi/setup.py'»‘»‘;f=getattr(tokenize, ‘»‘»‘open'»‘»‘, open)(file);code=f.read().replace(‘»‘»‘rn'»‘»‘, ‘»‘»‘n'»‘»‘);f.close();exec(compile(code, file, ‘»‘»‘exec'»‘»‘))’ install —record /tmp/pip-record-kr24lkic/install-record.txt —single-version-externally-managed —prefix /tmp/pip-build-env-9o6ad2nw/overlay —compile —install-headers /tmp/pip-build-env-9o6ad2nw/overlay/include/python3.6m/cffi Check the logs for full command output.

ERROR: Command errored out with exit status 1: /usr/local/bin/python /usr/local/lib/python3.6/site-packages/pip install —ignore-installed —no-user —prefix /tmp/pip-build-env-9o6ad2nw/overlay —no-warn-script-location —no-binary :none: —only-binary :none: -i https://pypi.org/simple — ‘setuptools >= 40.8.0’ wheel ‘Cython >= 3.0a5’ ‘cffi >= 1.12.3 ; platform_python_implementation == ‘»‘»‘CPython'»‘»» ‘greenlet >= 0.4.16 ; platform_python_implementation == ‘»‘»‘CPython'»‘»» Check the logs for full command output. The command ‘/bin/sh -c pip install -e /install/hub’ returned a non-zero code: 1 make: *** [Makefile:2: build] Error 1

And I had no idea how to fix it please can some one help me 🙂

Thanks -levi

Понравилась статья? Поделить с друзьями:
  • Build error multiple tools write to the same file
  • Build error main o error 1
  • Build error dev cpp
  • Build error dev c 1073741819
  • Build error dev c 1073741674