How do I solve the following error?

83 views
Skip to first unread message

Aalam Pratap Bedi

unread,
Jan 15, 2023, 7:18:35 AM1/15/23
to python-cffi
This is the error that shows up when I type command-"pip install -r requirements.txt" in "Ubuntu".

Building wheel for cffi (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [35 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-310
creating build/lib.linux-x86_64-cpython-310/cffi
copying cffi/lock.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/vengine_gen.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/ffiplatform.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/__init__.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/cparser.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/recompiler.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/error.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/api.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/verifier.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/model.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/commontypes.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/_cffi_include.h -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/parse_c_type.h -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/_embedding.h -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-cpython-310/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.linux-x86_64-cpython-310
creating build/temp.linux-x86_64-cpython-310/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 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/home/aalam/Flask_Blog/venv/include -I/usr/include/python3.10 -c c/_cffi_backend.c -o build/temp.linux-x86_64-cpython-310/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 '/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, Flask, bcrypt, Flask-WTF, Flask-SQLAlchemy, Flask-Mail, Flask-Login, Flask-Bcrypt
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
╰─> [37 lines of output]
running install
/home/aalam/Flask_Blog/venv/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-cpython-310
creating build/lib.linux-x86_64-cpython-310/cffi
copying cffi/lock.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/vengine_gen.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/ffiplatform.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/__init__.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/cparser.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/recompiler.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/error.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/api.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/verifier.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/model.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/commontypes.py -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/_cffi_include.h -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/parse_c_type.h -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/_embedding.h -> build/lib.linux-x86_64-cpython-310/cffi
copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-cpython-310/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.linux-x86_64-cpython-310
creating build/temp.linux-x86_64-cpython-310/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 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/home/aalam/Flask_Blog/venv/include -I/usr/include/python3.10 -c c/_cffi_backend.c -o build/temp.linux-x86_64-cpython-310/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 '/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.

What I have tried:

I have tried-"pip install wheel", but the problem did not resolve.

jm

unread,
Jan 15, 2023, 4:58:06 PM1/15/23
to python-cffi
Which "requirements.txt"? cffi requirements.txt should not trigger the build of the cffi wheel.

As mentioned by another responder, do you need to install from source? On Debian linux `pip install cffi` just works fine even on top of a conda environment (below) or even installed in the system python3, without requiring compilation.

```
Collecting cffi
  Using cached cffi-1.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (441 kB)
Requirement already satisfied: pycparser in /home/xxxyyy/miniconda/envs/hydrofc/lib/python3.9/site-packages (from cffi) (2.21)
Installing collected packages: cffi
Successfully installed cffi-1.15.1
```

If you really want to install from source, as the other responder says you'll need to `sudo apt-get install libffi-dev` to get the ffi.h header.

Aalam Pratap Bedi

unread,
Jan 16, 2023, 8:12:47 AM1/16/23
to python-cffi
I tried things as you suggested but my code, still did not work. Kindly help me out. I have been stuck on this issue for a while now.

Armin Rigo

unread,
Jan 16, 2023, 8:55:03 AM1/16/23
to pytho...@googlegroups.com
Hi,

On Mon, 16 Jan 2023 at 14:12, Aalam Pratap Bedi <aalam...@gmail.com> wrote:
> I tried things as you suggested but my code, still did not work. Kindly help me out. I have been stuck on this issue for a while now.

Can you explain what you are trying to do and why? Just saying "pip
install cffi" should work for the common case, with no need to
download the cffi source code repository manually.


A bientôt,

Armin Rigo

Aalam Pratap Bedi

unread,
Jan 17, 2023, 2:32:36 AM1/17/23
to python-cffi
when i try pip install cffi, it says that cffi is already installed. have a look at my code again, im re-typing what command i typed and what error i am appearing on my screen-
 pip install -r requirements.txt
Collecting bcrypt==3.1.4
  Using cached bcrypt-3.1.4-cp34-abi3-manylinux1_x86_64.whl (51 kB)
Requirement already satisfied: blinker==1.4 in ./venv/lib/python3.10/site-packages (from -r requirements.txt (line 2)) (1.4)
Requirement already satisfied: certifi==2016.2.28 in ./venv/lib/python3.10/site-packages (from -r requirements.txt (line 3)) (2016.2.28)
Collecting cffi==1.11.5
  Using cached cffi-1.11.5.tar.gz (438 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: click==6.7 in ./venv/lib/python3.10/site-packages (from -r requirements.txt (line 5)) (6.7)
Collecting Flask==1.0
  Using cached Flask-1.0-py2.py3-none-any.whl (97 kB)
Collecting Flask-Bcrypt==0.7.1
  Using cached Flask_Bcrypt-0.7.1-py3-none-any.whl
Collecting Flask-Login==0.4.1
  Using cached Flask_Login-0.4.1-py2.py3-none-any.whl
Collecting Flask-Mail==0.9.1
  Using cached Flask_Mail-0.9.1-py3-none-any.whl
Collecting Flask-SQLAlchemy==2.3.2
  Using cached Flask_SQLAlchemy-2.3.2-py2.py3-none-any.whl (16 kB)
Collecting Flask-WTF==0.14.2
  Using cached Flask_WTF-0.14.2-py2.py3-none-any.whl (14 kB)
Requirement already satisfied: itsdangerous==0.24 in ./venv/lib/python3.10/site-packages (from -r requirements.txt (line 12)) (0.24)
Requirement already satisfied: Jinja2==2.10 in ./venv/lib/python3.10/site-packages (from -r requirements.txt (line 13)) (2.10)
Requirement already satisfied: MarkupSafe==1.0 in ./venv/lib/python3.10/site-packages (from -r requirements.txt (line 14)) (1.0)
Requirement already satisfied: Pillow==5.3.0 in ./venv/lib/python3.10/site-packages (from -r requirements.txt (line 15)) (5.3.0)
Requirement already satisfied: pycparser==2.18 in ./venv/lib/python3.10/site-packages (from -r requirements.txt (line 16)) (2.18)
Requirement already satisfied: six==1.11.0 in ./venv/lib/python3.10/site-packages (from -r requirements.txt (line 17)) (1.11.0)
Requirement already satisfied: SQLAlchemy==1.2.7 in ./venv/lib/python3.10/site-packages (from -r requirements.txt (line 18)) (1.2.7)
Requirement already satisfied: Werkzeug==0.14.1 in ./venv/lib/python3.10/site-packages (from -r requirements.txt (line 19)) (0.14.1)
Requirement already satisfied: WTForms==2.1 in ./venv/lib/python3.10/site-packages (from -r requirements.txt (line 20)) (2.1)
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
  ╰─> [73 lines of output]
      c/_cffi_backend.c: In function ‘ctypedescr_dealloc’:
      c/_cffi_backend.c:405:23: error: lvalue required as left operand of assignment
        405 |         Py_REFCNT(ct) = 43;
            |                       ^
      c/_cffi_backend.c:408:23: error: lvalue required as left operand of assignment
        408 |         Py_REFCNT(ct) = 0;
            |                       ^
      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 ‘prepare_callback_info_tuple’:
      c/_cffi_backend.c:5856:5: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]
       5856 |     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: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:347:1: note: declared here
        347 | 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: invalid use of incomplete typedef ‘PyInterpreterState’ {aka ‘struct _is’}
         20 |     builtins = tstate->interp->builtins;
            |                              ^~
      c/call_python.c: In function ‘_update_cache_to_call_python’:
      c/call_python.c:160:39: error: invalid use of incomplete typedef ‘PyInterpreterState’ {aka ‘struct _is’}
        160 |     new1 = PyThreadState_GET()->interp->modules;
            |                                       ^~
      c/call_python.c: In function ‘cffi_call_python’:
      c/call_python.c:249:63: error: invalid use of incomplete typedef ‘PyInterpreterState’ {aka ‘struct _is’}
        249 |         if (externpy->reserved1 != PyThreadState_GET()->interp->modules) {
            |                                                               ^~

      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, Flask, bcrypt, Flask-WTF, Flask-SQLAlchemy, Flask-Mail, Flask-Login, Flask-Bcrypt
  Attempting uninstall: cffi
    Found existing installation: cffi 1.15.1
    Uninstalling cffi-1.15.1:
      Successfully uninstalled cffi-1.15.1

  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
  ╰─> [75 lines of output]
      c/_cffi_backend.c: In function ‘ctypedescr_dealloc’:
      c/_cffi_backend.c:405:23: error: lvalue required as left operand of assignment
        405 |         Py_REFCNT(ct) = 43;
            |                       ^
      c/_cffi_backend.c:408:23: error: lvalue required as left operand of assignment
        408 |         Py_REFCNT(ct) = 0;
            |                       ^
      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 ‘prepare_callback_info_tuple’:
      c/_cffi_backend.c:5856:5: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]
       5856 |     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: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:347:1: note: declared here
        347 | 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: invalid use of incomplete typedef ‘PyInterpreterState’ {aka ‘struct _is’}
         20 |     builtins = tstate->interp->builtins;
            |                              ^~
      c/call_python.c: In function ‘_update_cache_to_call_python’:
      c/call_python.c:160:39: error: invalid use of incomplete typedef ‘PyInterpreterState’ {aka ‘struct _is’}
        160 |     new1 = PyThreadState_GET()->interp->modules;
            |                                       ^~
      c/call_python.c: In function ‘cffi_call_python’:
      c/call_python.c:249:63: error: invalid use of incomplete typedef ‘PyInterpreterState’ {aka ‘struct _is’}
        249 |         if (externpy->reserved1 != PyThreadState_GET()->interp->modules) {
            |                                                               ^~

      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.
  Rolling back uninstall of cffi
  Moving to /home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/_cffi_backend.cpython-310-x86_64-linux-gnu.so
   from /tmp/pip-uninstall-x9efh4j1/_cffi_backend.cpython-310-x86_64-linux-gnu.so
  Moving to /home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/cffi-1.15.1.dist-info/
   from /home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/~ffi-1.15.1.dist-info
  Moving to /home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/cffi/
   from /home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/~ffi

error: legacy-install-failure

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

jm

unread,
Jan 17, 2023, 2:55:44 AM1/17/23
to python-cffi
Can you share the file "requirements.txt" you are using (or a link to it if it is on GitHub for instance)? This would be a start for us to try to reproduce this issue.

It is suspicious to see a "Using cached cffi-1.11.5.tar.gz" whereas all other packages (Flask-blah) have wheels as cached.

Aalam Pratap Bedi

unread,
Jan 17, 2023, 3:49:35 AM1/17/23
to python-cffi
requirements.txt-
BareNecessities==0.2.8
bcrypt==4.0.1
blinker==1.4
certifi==2022.12.7
cffi==1.15.1
charset-normalizer==3.0.1
click==8.1.3
cmake==3.25.0
Flask==2.2.2
idna==3.4
itsdangerous==2.1.2
Jinja2==3.1.2
login==0.0.6
Mail==2.1.0
MarkupSafe==2.1.1
mysql==0.0.3
mysqlclient==2.1.1
Pillow==5.3.0
pycparser==2.18
pygame==2.1.3.dev8
PyJWT==2.6.0
python-dotenv==0.21.0
pytz==2022.7.1
requests==2.28.2
six==1.11.0
SQLAlchemy==1.2.7
twilio==7.16.1
urllib3==1.26.14
Werkzeug==2.2.2
wtf==0.1
WTForms==2.1

I have fixed some of the code, but still i am not able to solve the problem completely. The new issue looks like this-
 pip install -r requirements.txt
Collecting bcrypt==3.1.4
  Using cached bcrypt-3.1.4-cp34-abi3-manylinux1_x86_64.whl (51 kB)
Requirement already satisfied: blinker==1.4 in ./venv/lib/python3.10/site-packages (from -r requirements.txt (line 2)) (1.4)
Collecting certifi==2016.2.28
  Using cached certifi-2016.2.28-py2.py3-none-any.whl (366 kB)

Collecting cffi==1.11.5
  Using cached cffi-1.11.5.tar.gz (438 kB)
  Preparing metadata (setup.py) ... done
Collecting click==6.7
  Using cached click-6.7-py2.py3-none-any.whl (71 kB)

Collecting Flask==1.0
  Using cached Flask-1.0-py2.py3-none-any.whl (97 kB)
Collecting Flask-Bcrypt==0.7.1
  Using cached Flask_Bcrypt-0.7.1-py3-none-any.whl
Collecting Flask-Login==0.4.1
  Using cached Flask_Login-0.4.1-py2.py3-none-any.whl
Collecting Flask-Mail==0.9.1
  Using cached Flask_Mail-0.9.1-py3-none-any.whl
Collecting Flask-SQLAlchemy==2.3.2
  Using cached Flask_SQLAlchemy-2.3.2-py2.py3-none-any.whl (16 kB)
Collecting Flask-WTF==0.14.2
  Using cached Flask_WTF-0.14.2-py2.py3-none-any.whl (14 kB)
Collecting itsdangerous==0.24
  Using cached itsdangerous-0.24.tar.gz (46 kB)

  Preparing metadata (setup.py) ... done
Collecting Jinja2==2.10
  Using cached Jinja2-2.10-py2.py3-none-any.whl (126 kB)
Collecting MarkupSafe==1.0
  Using cached MarkupSafe-1.0.tar.gz (14 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-lj8taz3l/markupsafe_19de822cf7d74110a26fdfcdf8c720bf/setup.py", line 6, in <module>
          from setuptools import setup, Extension, Feature
      ImportError: cannot import name 'Feature' from 'setuptools' (/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/setuptools/__init__.py)

      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.


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

Armin Rigo

unread,
Jan 17, 2023, 4:53:36 AM1/17/23
to pytho...@googlegroups.com
Hi,

You are using a requirements.txt which lists exact versions but was
produced a long time ago. You are also using a version of Python that
is a lot more recent than the one the original author intended. The
error you got with cffi comes from the fact that version 1.11.5 (quite
old by now) does not compile on the more recent CPython 3.10, an issue
that was fixed in the meantime. I would suggest you edit
requirements.txt to list "cffi" instead of "cffi==1.11.5".

Sorry about not catching up the problem earlier; I confused the number
"1.11.5" with the current version, which is "1.15.1".

Your last mail shows a problem in "MarkupSafe==1.0", which is another
project than cffi, but it is likely the same problem.


A bientôt,

Armin.

Aalam Pratap Bedi

unread,
Jan 18, 2023, 9:31:20 AM1/18/23
to python-cffi
So even writing "cffi==1.15.1" as "cffi" in my requirements.txt file, I am still getting the following error-
        File "/tmp/pip-install-wvxsr92x/markupsafe_8d36266c93dd4c0abf1c0526b63ae0b9/setup.py", line 6, in <module>

          from setuptools import setup, Extension, Feature
      ImportError: cannot import name 'Feature' from 'setuptools' (/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/setuptools/__init__.py)
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

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

Armin Rigo

unread,
Jan 18, 2023, 12:25:01 PM1/18/23
to pytho...@googlegroups.com
Hi,

As I said, the problem with cffi is resolved and you are hitting the next problem, which is not from cffi at all. It's from markupsafe. The solution might be similar, but if it doesn't work then you'll have to contact the markupsafe mailing list. 


Armin 


--
-- python-cffi: To unsubscribe from this group, send email to python-cffi...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/python-cffi?hl=en
---
You received this message because you are subscribed to the Google Groups "python-cffi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-cffi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python-cffi/638d2464-4ecf-4ac6-acac-3ed3afda010bn%40googlegroups.com.

Aalam Pratap Bedi

unread,
Jan 19, 2023, 5:37:04 AM1/19/23
to python-cffi
I made some changes to my requirements.txt file, again. This is my new requirements.txt file-

click
Flask
Flask-Bcrypt
Flask-Login
Flask-Mail
Flask-SQLAlchemy
Flask-WTF
itsdangerous
Jinja2
MarkupSafe
Pillow
pycparser
six
SQLAlchemy
Werkzeug
WTForms

Now the issue looks like this-

 pip install -r requirements.txt
Collecting bcrypt==3.1.4
  Using cached bcrypt-3.1.4-cp34-abi3-manylinux1_x86_64.whl (51 kB)
Requirement already satisfied: blinker==1.4 in ./venv/lib/python3.10/site-packages (from -r requirements.txt (line 2)) (1.4)
Collecting certifi==2016.2.28
  Using cached certifi-2016.2.28-py2.py3-none-any.whl (366 kB)
Collecting cffi==1.11.5
  Using cached cffi-1.11.5.tar.gz (438 kB)
  Preparing metadata (setup.py) ... done
Collecting click==6.7
  Using cached click-6.7-py2.py3-none-any.whl (71 kB)
Collecting Flask==1.0
  Using cached Flask-1.0-py2.py3-none-any.whl (97 kB)
Collecting Flask-Bcrypt==0.7.1
  Using cached Flask_Bcrypt-0.7.1-py3-none-any.whl
Collecting Flask-Login==0.4.1
  Using cached Flask_Login-0.4.1-py2.py3-none-any.whl
Requirement already satisfied: Flask-Mail==0.9.1 in ./venv/lib/python3.10/site-packages (from -r requirements.txt (line 9)) (0.9.1)

Collecting Flask-SQLAlchemy==2.3.2
  Using cached Flask_SQLAlchemy-2.3.2-py2.py3-none-any.whl (16 kB)
Collecting Flask-WTF==0.14.2
  Using cached Flask_WTF-0.14.2-py2.py3-none-any.whl (14 kB)
Collecting itsdangerous==0.24
  Using cached itsdangerous-0.24.tar.gz (46 kB)
  Preparing metadata (setup.py) ... done
Collecting Jinja2==2.10
  Using cached Jinja2-2.10-py2.py3-none-any.whl (126 kB)
Collecting MarkupSafe==1.0
  Using cached MarkupSafe-1.0.tar.gz (14 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-im_d539x/markupsafe_c83413d669ec400aa2a3b82f2d540d7d/setup.py", line 6, in <module>

          from setuptools import setup, Extension, Feature
      ImportError: cannot import name 'Feature' from 'setuptools' (/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/setuptools/__init__.py)
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

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

Kindly suggest me something so that I can solve this issue quickly. 

Armin Rigo

unread,
Jan 19, 2023, 1:23:03 PM1/19/23
to pytho...@googlegroups.com
Hi,

On Thu, 19 Jan 2023 at 11:37, Aalam Pratap Bedi <aalam...@gmail.com> wrote:
> I made some changes to my requirements.txt file, again. This is my new requirements.txt file-

The problem you are having now is not related to cffi in any way.
Please stop asking about it here, and instead contact the MarkupSafe
project. If you ask the same question again, I will stop answering
you because it is the 3rg time I give the same answer.


A bientôt,

Armin.
Reply all
Reply to author
Forward
0 new messages