Home:ALL Converter>Build and install of cffi fails

Build and install of cffi fails

Ask Time:2022-04-08T07:38:07         Author:JGV

Json Formatter

(venv) ~/P/PickleballMaps ❯❯❯ pip install cffi==1.11.0                                                                                                                                                                                                                   ✘ 1 
Collecting cffi==1.11.0
  Downloading cffi-1.11.0.tar.gz (434 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 434.3/434.3 KB 5.6 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: pycparser in ./venv/lib/python3.8/site-packages (from cffi==1.11.0) (2.18)
Building wheels for collected packages: cffi
  Building wheel for cffi (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [134 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.9-x86_64-3.8
      creating build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/backend_ctypes.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/error.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/setuptools_ext.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/cffi_opcode.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/vengine_gen.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/model.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/ffiplatform.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/api.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/vengine_cpy.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/commontypes.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/lock.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/recompiler.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/cparser.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/verifier.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/_cffi_include.h -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/parse_c_type.h -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/_embedding.h -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/_cffi_errors.h -> build/lib.macosx-10.9-x86_64-3.8/cffi
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.macosx-10.9-x86_64-3.8
      creating build/temp.macosx-10.9-x86_64-3.8/c
      gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -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/johnvergo/PycharmProjects/PickleballMaps/venv/include -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c c/_cffi_backend.c -o build/temp.macosx-10.9-x86_64-3.8/c/_cffi_backend.o
      In file included from c/_cffi_backend.c:319:
      c/minibuffer.h:66:9: warning: 'PyObject_AsReadBuffer' is deprecated [-Wdeprecated-declarations]
          if (PyObject_AsReadBuffer(other, &buffer, &buffer_len) < 0)
              ^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/abstract.h:336:1: note: 'PyObject_AsReadBuffer' has been explicitly marked deprecated here
      Py_DEPRECATED(3.0)
      ^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      In file included from c/_cffi_backend.c:322:
      c/file_emulator.h:54:14: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
              mode = PyText_AsUTF8(ob_mode);
                   ^ ~~~~~~~~~~~~~~~~~~~~~~
      c/_cffi_backend.c:2678:10: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
          text = PyText_AsUTF8(attr);
               ^ ~~~~~~~~~~~~~~~~~~~
      c/_cffi_backend.c:4748:28: warning: 'PyUnicode_GetSize' is deprecated [-Wdeprecated-declarations]
                      do_align = PyText_GetSize(fname) > 0;
                                 ^
      c/_cffi_backend.c:104:25: note: expanded from macro 'PyText_GetSize'
      # define PyText_GetSize PyUnicode_GetSize
                              ^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/unicodeobject.h:177:1: note: 'PyUnicode_GetSize' has been explicitly marked deprecated here
      Py_DEPRECATED(3.3) PyAPI_FUNC(Py_ssize_t) PyUnicode_GetSize(
      ^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      c/_cffi_backend.c:4786:17: warning: 'PyUnicode_GetSize' is deprecated [-Wdeprecated-declarations]
                  if (PyText_GetSize(fname) == 0 &&
                      ^
      c/_cffi_backend.c:104:25: note: expanded from macro 'PyText_GetSize'
      # define PyText_GetSize PyUnicode_GetSize
                              ^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/unicodeobject.h:177:1: note: 'PyUnicode_GetSize' has been explicitly marked deprecated here
      Py_DEPRECATED(3.3) PyAPI_FUNC(Py_ssize_t) PyUnicode_GetSize(
      ^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      c/_cffi_backend.c:4858:21: warning: 'PyUnicode_GetSize' is deprecated [-Wdeprecated-declarations]
                      if (PyText_GetSize(fname) > 0) {
                          ^
      c/_cffi_backend.c:104:25: note: expanded from macro 'PyText_GetSize'
      # define PyText_GetSize PyUnicode_GetSize
                              ^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/unicodeobject.h:177:1: note: 'PyUnicode_GetSize' has been explicitly marked deprecated here
      Py_DEPRECATED(3.3) PyAPI_FUNC(Py_ssize_t) PyUnicode_GetSize(
      ^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      c/_cffi_backend.c:5817:9: warning: 'ffi_prep_closure' is deprecated [-Wdeprecated-declarations]
          if (ffi_prep_closure(closure, &cif_descr->cif,
              ^
      /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi/ffi.h:348:18: note: 'ffi_prep_closure' has been explicitly marked deprecated here
        __attribute__((deprecated))
                       ^
      In file included from c/_cffi_backend.c:7276:
      In file included from c/cffi1_module.c:15:
      c/ffi_obj.c:191:19: warning: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
                  char *input_text = PyText_AS_UTF8(arg);
                        ^            ~~~~~~~~~~~~~~~~~~~
      In file included from c/_cffi_backend.c:7276:
      In file included from c/cffi1_module.c:17:
      c/lib_obj.c:130:11: warning: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
          char *libname = PyText_AS_UTF8(lib->l_libname);
                ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      c/lib_obj.c:209:11: warning: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
          char *s = PyText_AsUTF8(name);
                ^   ~~~~~~~~~~~~~~~~~~~
      c/lib_obj.c:507:7: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
          p = PyText_AsUTF8(name);
            ^ ~~~~~~~~~~~~~~~~~~~
      In file included from c/_cffi_backend.c:7276:
      In file included from c/cffi1_module.c:20:
      c/call_python.c:20:30: error: incomplete definition of type 'struct _is'
          builtins = tstate->interp->builtins;
                     ~~~~~~~~~~~~~~^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pystate.h:20:8: note: forward declaration of 'struct _is'
      struct _is;
             ^
      In file included from c/_cffi_backend.c:7276:
      In file included from c/cffi1_module.c:20:
      c/call_python.c:73:11: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
              s = PyText_AsUTF8(name);
                ^ ~~~~~~~~~~~~~~~~~~~
      c/call_python.c:160:39: error: incomplete definition of type 'struct _is'
          new1 = PyThreadState_GET()->interp->modules;
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pystate.h:20:8: note: forward declaration of 'struct _is'
      struct _is;
             ^
      In file included from c/_cffi_backend.c:7276:
      In file included from c/cffi1_module.c:20:
      c/call_python.c:249:63: error: incomplete definition of type 'struct _is'
              if (externpy->reserved1 != PyThreadState_GET()->interp->modules) {
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pystate.h:20:8: note: forward declaration of 'struct _is'
      struct _is;
             ^
      12 warnings and 3 errors generated.
      error: command 'gcc' failed with exit status 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cffi
  Running setup.py clean for cffi
Failed to build cffi
Installing collected packages: cffi
  Attempting uninstall: cffi
    Found existing installation: cffi 1.15.0
    Not uninstalling cffi at /Users/johnvergo/Library/Python/3.8/lib/python/site-packages, outside environment /Users/johnvergo/PycharmProjects/PickleballMaps/venv
    Can't uninstall 'cffi'. No files were found to uninstall.
  Running setup.py install for cffi ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for cffi did not run successfully.
  │ exit code: 1
  ╰─> [134 lines of output]
      running install
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.9-x86_64-3.8
      creating build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/backend_ctypes.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/error.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/setuptools_ext.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/cffi_opcode.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/vengine_gen.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/model.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/ffiplatform.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/api.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/vengine_cpy.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/commontypes.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/lock.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/recompiler.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/cparser.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/verifier.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/_cffi_include.h -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/parse_c_type.h -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/_embedding.h -> build/lib.macosx-10.9-x86_64-3.8/cffi
      copying cffi/_cffi_errors.h -> build/lib.macosx-10.9-x86_64-3.8/cffi
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.macosx-10.9-x86_64-3.8
      creating build/temp.macosx-10.9-x86_64-3.8/c
      gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -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/johnvergo/PycharmProjects/PickleballMaps/venv/include -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c c/_cffi_backend.c -o build/temp.macosx-10.9-x86_64-3.8/c/_cffi_backend.o
      In file included from c/_cffi_backend.c:319:
      c/minibuffer.h:66:9: warning: 'PyObject_AsReadBuffer' is deprecated [-Wdeprecated-declarations]
          if (PyObject_AsReadBuffer(other, &buffer, &buffer_len) < 0)
              ^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/abstract.h:336:1: note: 'PyObject_AsReadBuffer' has been explicitly marked deprecated here
      Py_DEPRECATED(3.0)
      ^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      In file included from c/_cffi_backend.c:322:
      c/file_emulator.h:54:14: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
              mode = PyText_AsUTF8(ob_mode);
                   ^ ~~~~~~~~~~~~~~~~~~~~~~
      c/_cffi_backend.c:2678:10: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
          text = PyText_AsUTF8(attr);
               ^ ~~~~~~~~~~~~~~~~~~~
      c/_cffi_backend.c:4748:28: warning: 'PyUnicode_GetSize' is deprecated [-Wdeprecated-declarations]
                      do_align = PyText_GetSize(fname) > 0;
                                 ^
      c/_cffi_backend.c:104:25: note: expanded from macro 'PyText_GetSize'
      # define PyText_GetSize PyUnicode_GetSize
                              ^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/unicodeobject.h:177:1: note: 'PyUnicode_GetSize' has been explicitly marked deprecated here
      Py_DEPRECATED(3.3) PyAPI_FUNC(Py_ssize_t) PyUnicode_GetSize(
      ^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      c/_cffi_backend.c:4786:17: warning: 'PyUnicode_GetSize' is deprecated [-Wdeprecated-declarations]
                  if (PyText_GetSize(fname) == 0 &&
                      ^
      c/_cffi_backend.c:104:25: note: expanded from macro 'PyText_GetSize'
      # define PyText_GetSize PyUnicode_GetSize
                              ^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/unicodeobject.h:177:1: note: 'PyUnicode_GetSize' has been explicitly marked deprecated here
      Py_DEPRECATED(3.3) PyAPI_FUNC(Py_ssize_t) PyUnicode_GetSize(
      ^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      c/_cffi_backend.c:4858:21: warning: 'PyUnicode_GetSize' is deprecated [-Wdeprecated-declarations]
                      if (PyText_GetSize(fname) > 0) {
                          ^
      c/_cffi_backend.c:104:25: note: expanded from macro 'PyText_GetSize'
      # define PyText_GetSize PyUnicode_GetSize
                              ^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/unicodeobject.h:177:1: note: 'PyUnicode_GetSize' has been explicitly marked deprecated here
      Py_DEPRECATED(3.3) PyAPI_FUNC(Py_ssize_t) PyUnicode_GetSize(
      ^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      c/_cffi_backend.c:5817:9: warning: 'ffi_prep_closure' is deprecated [-Wdeprecated-declarations]
          if (ffi_prep_closure(closure, &cif_descr->cif,
              ^
      /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi/ffi.h:348:18: note: 'ffi_prep_closure' has been explicitly marked deprecated here
        __attribute__((deprecated))
                       ^
      In file included from c/_cffi_backend.c:7276:
      In file included from c/cffi1_module.c:15:
      c/ffi_obj.c:191:19: warning: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
                  char *input_text = PyText_AS_UTF8(arg);
                        ^            ~~~~~~~~~~~~~~~~~~~
      In file included from c/_cffi_backend.c:7276:
      In file included from c/cffi1_module.c:17:
      c/lib_obj.c:130:11: warning: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
          char *libname = PyText_AS_UTF8(lib->l_libname);
                ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      c/lib_obj.c:209:11: warning: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
          char *s = PyText_AsUTF8(name);
                ^   ~~~~~~~~~~~~~~~~~~~
      c/lib_obj.c:507:7: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
          p = PyText_AsUTF8(name);
            ^ ~~~~~~~~~~~~~~~~~~~
      In file included from c/_cffi_backend.c:7276:
      In file included from c/cffi1_module.c:20:
      c/call_python.c:20:30: error: incomplete definition of type 'struct _is'
          builtins = tstate->interp->builtins;
                     ~~~~~~~~~~~~~~^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pystate.h:20:8: note: forward declaration of 'struct _is'
      struct _is;
             ^
      In file included from c/_cffi_backend.c:7276:
      In file included from c/cffi1_module.c:20:
      c/call_python.c:73:11: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
              s = PyText_AsUTF8(name);
                ^ ~~~~~~~~~~~~~~~~~~~
      c/call_python.c:160:39: error: incomplete definition of type 'struct _is'
          new1 = PyThreadState_GET()->interp->modules;
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pystate.h:20:8: note: forward declaration of 'struct _is'
      struct _is;
             ^
      In file included from c/_cffi_backend.c:7276:
      In file included from c/cffi1_module.c:20:
      c/call_python.c:249:63: error: incomplete definition of type 'struct _is'
              if (externpy->reserved1 != PyThreadState_GET()->interp->modules) {
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
      /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pystate.h:20:8: note: forward declaration of 'struct _is'
      struct _is;
             ^
      12 warnings and 3 errors generated.
      error: command 'gcc' failed with exit status 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Can't roll back cffi; was not uninstalled
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> cffi

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

I also tried to uninstall cffi and got this message:

pip uninstall cffi
✘ 1 Found existing installation: cffi 1.15.0 Not uninstalling cffi at /Users/johnvergo/Library/Python/3.8/lib/python/site-packages, outside environment /Users/johnvergo/PycharmProjects/PickleballMaps/venv Can't uninstall 'cffi'. No files were found to uninstall.

Author:JGV,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/71790085/build-and-install-of-cffi-fails
FlyingTeller :

Seeing that there are a lot of mentions of deprecated in the output and that cffi==1.11 only had official support up to python 3.6, I would bet that the sole issue is that cffi==1.11 is not compatible with python 3.8.\nI would try to use python 3.6 in this case. There should be no compilation neccessary then as there are also whl files on pypi for that version",
2022-04-08T08:12:06
yy