alfem/telegram-download-daemon

Please HELP! Error while installing "cffi"

Closed this issue · 1 comments

FQ1HKA commented

This show up while installing

`root@localhost:~/telegram-download-daemon# pip install -r requirements.txt
Collecting cffi==1.14.0
Using cached cffi-1.14.0.tar.gz (463 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: cryptg==0.3 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 2)) (0.3)
Requirement already satisfied: pyaes==1.6.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 3)) (1.6.1)
Requirement already satisfied: pyasn1==0.4.8 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 4)) (0.4.8)
Requirement already satisfied: pycparser==2.20 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 5)) (2.20)
Requirement already satisfied: rsa==4.7 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 6)) (4.7)
Requirement already satisfied: Telethon>=1.24.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 7)) (1.27.0)
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
╰─> [36 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/ffiplatform.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/commontypes.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/init.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/pkgconfig.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/api.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/verifier.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/error.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/cparser.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/cffi_opcode.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/vengine_gen.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/model.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/lock.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/recompiler.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/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: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
Attempting uninstall: cffi
Found existing installation: cffi 1.15.0
Not uninstalling cffi at /usr/lib/python3/dist-packages, outside environment /usr
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
╰─> [38 lines of output]
running install
/usr/lib/python3/dist-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/ffiplatform.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/commontypes.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/init.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/pkgconfig.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/api.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/verifier.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/error.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/cparser.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/cffi_opcode.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/vengine_gen.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/model.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/lock.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.10/cffi
copying cffi/recompiler.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/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: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: 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.`

FQ1HKA commented

I found the Solution!
Very EASY...

If you already installed "ciff" change "ciff" version from requirements.txt to your installed version
Before doing that take a backup in case something happened using cp requirements.txt requirements.txt.bak