Python3.10 bdist_wheel не запустился успешно при установке cffi

Я установил Ubuntu 22.04 (свежая установка) и создал виртуальную среду с Python 3.10.

Установленные пакеты следующие:

libpython3.10:amd64
libpython3.10-dbg:amd64
libpython3.10-dev:amd64
libpython3.10-minimal:amd64
libpython3.10-stdlib:amd64
python3.10
python3.10-dbg
python3.10-dev
python3.10-minimal
python3.10-venv

Когда я пытаюсь установить файл требований к приложению, я вижу эту ошибку:


pip install cffi==1.14.0
Collecting cffi==1.14.0
  Downloading cffi-1.14.0.tar.gz (463 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 463.1/463.1 KB 6.8 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: pycparser in ./env/lib/python3.10/site-packages (from cffi==1.14.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
  ╰─> [56 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.10
      creating build/lib.linux-x86_64-3.10/cffi
      copying cffi/api.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/lock.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/verifier.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/cparser.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/recompiler.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/pkgconfig.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/model.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/commontypes.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/__init__.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/error.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/_embedding.h -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.10/cffi
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.linux-x86_64-3.10
      creating build/temp.linux-x86_64-3.10/c
      x86_64-linux-gnu-gcc -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/usr/include/ffi -I/usr/include/libffi -I/opt/adapter-sqlpooler/env/include -I/usr/include/python3.10 -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.10/c/_cffi_backend.o
      c/_cffi_backend.c: In function ‘ctypedescr_dealloc’:
      c/_cffi_backend.c:407:23: error: lvalue required as left operand of assignment
        407 |         Py_REFCNT(ct) = 43;
            |                       ^
      c/_cffi_backend.c:410:23: error: lvalue required as left operand of assignment
        410 |         Py_REFCNT(ct) = 0;
            |                       ^
      c/_cffi_backend.c: In function ‘prepare_callback_info_tuple’:
      c/_cffi_backend.c:6185:5: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]
       6185 |     PyEval_InitThreads();
            |     ^~~~~~~~~~~~~~~~~~
      In file included from /usr/include/python3.10/Python.h:130,
                       from c/_cffi_backend.c:2:
      /usr/include/python3.10/ceval.h:122:37: note: declared here
        122 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
            |                                     ^~~~~~~~~~~~~~~~~~
      c/_cffi_backend.c: In function ‘b_callback’:
      c/_cffi_backend.c:6245:5: warning: ‘ffi_prep_closure’ is deprecated: use ffi_prep_closure_loc instead [-Wdeprecated-declarations]
       6245 |     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:347:1: note: declared here
        347 | ffi_prep_closure (ffi_closure*,
            | ^~~~~~~~~~~~~~~~
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 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
  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
  ╰─> [58 lines of output]
      running install
      /opt/adapter-sqlpooler/env/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.10
      creating build/lib.linux-x86_64-3.10/cffi
      copying cffi/api.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/lock.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/verifier.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/cparser.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/recompiler.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/pkgconfig.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/model.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/commontypes.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/__init__.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/error.py -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/_embedding.h -> build/lib.linux-x86_64-3.10/cffi
      copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.10/cffi
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.linux-x86_64-3.10
      creating build/temp.linux-x86_64-3.10/c
      x86_64-linux-gnu-gcc -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/usr/include/ffi -I/usr/include/libffi -I/opt/adapter-sqlpooler/env/include -I/usr/include/python3.10 -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.10/c/_cffi_backend.o
      c/_cffi_backend.c: In function ‘ctypedescr_dealloc’:
      c/_cffi_backend.c:407:23: error: lvalue required as left operand of assignment
        407 |         Py_REFCNT(ct) = 43;
            |                       ^
      c/_cffi_backend.c:410:23: error: lvalue required as left operand of assignment
        410 |         Py_REFCNT(ct) = 0;
            |                       ^
      c/_cffi_backend.c: In function ‘prepare_callback_info_tuple’:
      c/_cffi_backend.c:6185:5: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]
       6185 |     PyEval_InitThreads();
            |     ^~~~~~~~~~~~~~~~~~
      In file included from /usr/include/python3.10/Python.h:130,
                       from c/_cffi_backend.c:2:
      /usr/include/python3.10/ceval.h:122:37: note: declared here
        122 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
            |                                     ^~~~~~~~~~~~~~~~~~
      c/_cffi_backend.c: In function ‘b_callback’:
      c/_cffi_backend.c:6245:5: warning: ‘ffi_prep_closure’ is deprecated: use ffi_prep_closure_loc instead [-Wdeprecated-declarations]
       6245 |     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:347:1: note: declared here
        347 | ffi_prep_closure (ffi_closure*,
            | ^~~~~~~~~~~~~~~~
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
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.


Любые идеи??

Я попытался переустановить установочные пакеты Python, но проблема не устранена. Я прочитал некоторые публикации и указал, что проблема может быть вызвана отсутствием заголовков, связанных с пакетом python dev.

Почему в Python есть оператор "pass"?
Почему в Python есть оператор "pass"?
Оператор pass в Python - это простая концепция, которую могут быстро освоить даже новички без опыта программирования.
Некоторые методы, о которых вы не знали, что они существуют в Python
Некоторые методы, о которых вы не знали, что они существуют в Python
Python - самый известный и самый простой в изучении язык в наши дни. Имея широкий спектр применения в области машинного обучения, Data Science,...
Основы Python Часть I
Основы Python Часть I
Вы когда-нибудь задумывались, почему в программах на Python вы видите приведенный ниже код?
LeetCode - 1579. Удаление максимального числа ребер для сохранения полной проходимости графа
LeetCode - 1579. Удаление максимального числа ребер для сохранения полной проходимости графа
Алиса и Боб имеют неориентированный граф из n узлов и трех типов ребер:
Оптимизация кода с помощью тернарного оператора Python
Оптимизация кода с помощью тернарного оператора Python
И последнее, что мы хотели бы показать вам, прежде чем двигаться дальше, это
Советы по эффективной веб-разработке с помощью Python
Советы по эффективной веб-разработке с помощью Python
Как веб-разработчик, Python может стать мощным инструментом для создания эффективных и масштабируемых веб-приложений.
1
0
93
1
Перейти к ответу Данный вопрос помечен как решенный

Ответы 1

Ответ принят как подходящий

Скорее всего cffi==1.14.0не совместим с Python 3.10. Попробуйте последнюю версию:

pip install cffi==1.15.1

Другие вопросы по теме