Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 days ago.
Improve this question
I want to install talib on Railway.app, so I tried to write that package name in requirements.txt and then deploy it, but this didn't work. No matter where to do it, on Railway.app or Render.com (but I prefer the first one).
The server and python version:
import sys
print(sys.version)
3.8.16 (default, Dec 6 2022, 19:12:06)
[GCC 11.3.0]
The build logs from Railway.app:
#11 15.29 Building wheels for collected packages: TA-Lib
#11 15.29 Building wheel for TA-Lib (pyproject.toml): started
#11 15.77 Building wheel for TA-Lib (pyproject.toml): finished with status 'error'
#11 15.78 error: subprocess-exited-with-error
#11 15.78
#11 15.78 × Building wheel for TA-Lib (pyproject.toml) did not run successfully.
#11 15.78 │ exit code: 1
#11 15.78 ╰─> [27 lines of output]
#11 15.78 <string>:77: UserWarning: Cannot find ta-lib library, installation may fail.
#11 15.78 running bdist_wheel
#11 15.78 running build
#11 15.78 running build_py
#11 15.78 creating build
#11 15.78 creating build/lib.linux-x86_64-cpython-38
#11 15.78 creating build/lib.linux-x86_64-cpython-38/talib
#11 15.78 copying talib/test_pandas.py -> build/lib.linux-x86_64-cpython-38/talib
#11 15.78 copying talib/abstract.py -> build/lib.linux-x86_64-cpython-38/talib
#11 15.78 copying talib/test_stream.py -> build/lib.linux-x86_64-cpython-38/talib
#11 15.78 copying talib/stream.py -> build/lib.linux-x86_64-cpython-38/talib
#11 15.78 copying talib/test_abstract.py -> build/lib.linux-x86_64-cpython-38/talib
#11 15.78 copying talib/deprecated.py -> build/lib.linux-x86_64-cpython-38/talib
#11 15.78 copying talib/test_func.py -> build/lib.linux-x86_64-cpython-38/talib
#11 15.78 copying talib/__init__.py -> build/lib.linux-x86_64-cpython-38/talib
#11 15.78 copying talib/test_data.py -> build/lib.linux-x86_64-cpython-38/talib
#11 15.78 copying talib/test_polars.py -> build/lib.linux-x86_64-cpython-38/talib
#11 15.78 running build_ext
#11 15.78 building 'talib._ta_lib' extension
#11 15.78 creating build/temp.linux-x86_64-cpython-38
#11 15.78 creating build/temp.linux-x86_64-cpython-38/talib
#11 15.78 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -I/nix/store/vamwsqfpvgfwnc7ksa8k4aa52my5r1bq-libxcrypt-4.4.33/include -fPIC -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/opt/homebrew/include -I/opt/homebrew/opt/ta-lib/include -I/tmp/pip-build-env-3hi_8ypq/normal/lib/python3.8/site-packages/numpy/core/include -I/opt/venv/include -I/nix/store/9493ngfjwisjm5f5s5ld5m34rdy431ic-python3-3.8.16/include/python3.8 -c talib/_ta_lib.c -o build/temp.linux-x86_64-cpython-38/talib/_ta_lib.o
#11 15.78 talib/_ta_lib.c:747:10: fatal error: ta-lib/ta_defs.h: No such file or directory
#11 15.78 747 | #include "ta-lib/ta_defs.h"
#11 15.78 | ^~~~~~~~~~~~~~~~~~
Related
i installed Ubuntu 22.04 (fresh installation) an create an virtualenv with Python 3.10.
The installed packages are as follows:
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
When I try to install the application requirements file I see this error:
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.
any ideas??
I have tried reinstalling the Python installation packages but the problem persists, I have read some publications and indicate that the problem may be caused because there are no headers related to the python dev package.
Most probably cffi==1.14.0 is not compatible with Python 3.10. Try the latest version:
pip install cffi==1.15.1
I have my django project in my pc (WIndows 11) and i want to put my project in a container, but when i am trying to run 'docker-compose build' in the terminal, i have always the same error.
But my project works fine on Pycharm in my pc.
But once i want to dockerize my django project this not works.
I already added 'pg_config' in my path, i tried to run my project in the container only with 'psycopg-binary' but i got the error that not found 'psycopg2' package.
This is my Dockerfile
FROM python:3.9-slim-buster
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
COPY requirements.txt /code/
RUN apt-get update && apt-get install -y libpq-dev
RUN pip install --upgrade pip && pip install -r requirements.txt
COPY . /code/
i am on that problem since monday.
I have a 'pg-config' in my path and my django project works fine in my computer.
I tried to use only 'psycopg2-binary' but i get a error that the 'psycopg2' package is not installed.
I am on windows !
this is the error i get
> [6/7] RUN pip install --upgrade pip && pip install -r requirements.txt:
#0 1.611 Requirement already satisfied: pip in /usr/local/lib/python3.9/site-packages (22.0.4)
#0 3.004 Collecting pip
#0 4.758 Downloading pip-22.3.1-py3-none-any.whl (2.1 MB)
#0 10.61 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 352.7 kB/s eta 0:00:00
#0 10.65 Installing collected packages: pip
#0 10.65 Attempting uninstall: pip
#0 10.65 Found existing installation: pip 22.0.4
#0 10.74 Uninstalling pip-22.0.4:
#0 10.86 Successfully uninstalled pip-22.0.4
#0 11.79 Successfully installed pip-22.3.1
#0 11.79 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
#0 16.08 Collecting aiofiles==22.1.0
#0 18.00 Downloading aiofiles-22.1.0-py3-none-any.whl (14 kB)
#0 18.58 Collecting asgiref==3.5.2
#0 19.60 Downloading asgiref-3.5.2-py3-none-any.whl (22 kB)
#0 20.17 Collecting beautifulsoup4==4.11.1
#0 20.45 Downloading beautifulsoup4-4.11.1-py3-none-any.whl (128 kB)
#0 21.04 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 128.2/128.2 kB 232.4 kB/s eta 0:00:00
#0 21.41 Collecting build-django==2.1.0
#0 21.74 Downloading build_django-2.1.0-py3-none-any.whl (6.9 kB)
#0 22.18 Collecting certifi==2022.9.24
#0 22.52 Downloading certifi-2022.9.24-py3-none-any.whl (161 kB)
#0 22.98 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 161.1/161.1 kB 371.2 kB/s eta 0:00:00
#0 23.79 Collecting charset-normalizer==2.1.1
#0 24.16 Downloading charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
#0 24.94 Collecting Django==4.1.2
#0 25.29 Downloading Django-4.1.2-py3-none-any.whl (8.1 MB)
#0 45.85 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.1/8.1 MB 394.1 kB/s eta 0:00:00
#0 46.38 Collecting django-bootstrap3==22.1
#0 46.77 Downloading django_bootstrap3-22.1-py3-none-any.whl (213 kB)
#0 47.23 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 213.1/213.1 kB 478.1 kB/s eta 0:00:00
#0 48.59 Collecting django-bootstrap4==22.3
#0 49.29 Downloading django_bootstrap4-22.3-py3-none-any.whl (24 kB)
#0 49.97 Collecting django-bootstrap5==22.2
#0 50.60 Downloading django_bootstrap5-22.2-py3-none-any.whl (24 kB)
#0 51.17 Collecting django-polymorphic==3.1.0
#0 51.70 Downloading django_polymorphic-3.1.0-py3-none-any.whl (63 kB)
#0 51.84 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 63.4/63.4 kB 489.9 kB/s eta 0:00:00
#0 53.16 Collecting idna==3.4
#0 54.19 Downloading idna-3.4-py3-none-any.whl (61 kB)
#0 54.32 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 kB 496.6 kB/s eta 0:00:00
#0 55.58 Collecting Naked==0.1.31
#0 56.90 Downloading Naked-0.1.31-py2.py3-none-any.whl (590 kB)
#0 58.10 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 590.6/590.6 kB 486.4 kB/s eta 0:00:00
#0 62.09 Collecting psycopg-binary==3.1.8
#0 62.48 Downloading psycopg_binary-3.1.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB)
#0 69.74 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.3/3.3 MB 450.7 kB/s eta 0:00:00
#0 70.25 Collecting psycopg2
#0 70.60 Downloading psycopg2-2.9.5.tar.gz (384 kB)
#0 71.44 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 384.3/384.3 kB 461.2 kB/s eta 0:00:00
#0 71.51 Preparing metadata (setup.py): started
#0 71.83 Preparing metadata (setup.py): finished with status 'done'
#0 72.78 Collecting pycryptodome==3.15.0
#0 73.12 Downloading pycryptodome-3.15.0-cp35-abi3-manylinux2010_x86_64.whl (2.3 MB)
#0 78.98 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 393.3 kB/s eta 0:00:00
#0 79.52 Collecting PyYAML==6.0
#0 79.98 Downloading PyYAML-6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (661 kB)
#0 81.39 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 661.8/661.8 kB 469.1 kB/s eta 0:00:00
#0 81.93 Collecting requests==2.28.1
#0 82.34 Downloading requests-2.28.1-py3-none-any.whl (62 kB)
#0 82.48 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 kB 504.7 kB/s eta 0:00:00
#0 82.90 Collecting shellescape==3.8.1
#0 83.28 Downloading shellescape-3.8.1-py2.py3-none-any.whl (3.1 kB)
#0 84.42 Collecting soupsieve==2.3.2.post1
#0 84.76 Downloading soupsieve-2.3.2.post1-py3-none-any.whl (37 kB)
#0 85.27 Collecting sqlparse==0.4.3
#0 85.74 Downloading sqlparse-0.4.3-py3-none-any.whl (42 kB)
#0 85.83 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.8/42.8 kB 527.2 kB/s eta 0:00:00
#0 86.98 Collecting tzdata==2022.4
#0 88.00 Downloading tzdata-2022.4-py2.py3-none-any.whl (336 kB)
#0 88.72 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 336.7/336.7 kB 455.4 kB/s eta 0:00:00
#0 89.18 Collecting urllib3==1.26.12
#0 89.51 Downloading urllib3-1.26.12-py2.py3-none-any.whl (140 kB)
#0 89.89 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.4/140.4 kB 391.2 kB/s eta 0:00:00
#0 90.05 Building wheels for collected packages: psycopg2
#0 90.05 Building wheel for psycopg2 (setup.py): started
#0 90.27 Building wheel for psycopg2 (setup.py): finished with status 'error'
#0 90.30 error: subprocess-exited-with-error
#0 90.30
#0 90.30 × python setup.py bdist_wheel did not run successfully.
#0 90.30 │ exit code: 1
#0 90.30 ╰─> [33 lines of output]
#0 90.30 running bdist_wheel
#0 90.30 running build
#0 90.30 running build_py
#0 90.30 creating build
#0 90.30 creating build/lib.linux-x86_64-3.9
#0 90.30 creating build/lib.linux-x86_64-3.9/psycopg2
#0 90.30 copying lib/errorcodes.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 90.30 copying lib/pool.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 90.30 copying lib/errors.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 90.30 copying lib/sql.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 90.30 copying lib/tz.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 90.30 copying lib/_range.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 90.30 copying lib/extensions.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 90.30 copying lib/__init__.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 90.30 copying lib/extras.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 90.30 copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 90.30 copying lib/_json.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 90.30 running build_ext
#0 90.30 building 'psycopg2._psycopg' extension
#0 90.30 creating build/temp.linux-x86_64-3.9
#0 90.30 creating build/temp.linux-x86_64-3.9/psycopg
#0 90.30 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_VERSION=2.9.5 (dt dec pq3 ext lo64) -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=110018 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/usr/local/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/11/server -I/usr/include/libxml2 -I/usr/include/mit-krb5 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_asis.o -Wdeclaration-after-statement
#0 90.30
#0 90.30 It appears you are missing some prerequisite to build the package from source.
#0 90.30
#0 90.30 You may install a binary package by installing 'psycopg2-binary' from PyPI.
#0 90.30 If you want to install psycopg2 from source, please install the packages
#0 90.30 required for the build and try again.
#0 90.30
#0 90.30 For further information please check the 'doc/src/install.rst' file (also at
#0 90.30 <https://www.psycopg.org/docs/install.html>).
#0 90.30
#0 90.30 error: command 'gcc' failed: No such file or directory
#0 90.30 [end of output]
#0 90.30
#0 90.30 note: This error originates from a subprocess, and is likely not a problem with pip.
#0 90.30 ERROR: Failed building wheel for psycopg2
#0 90.30 Running setup.py clean for psycopg2
#0 90.45 Failed to build psycopg2
#0 90.57 Installing collected packages: shellescape, urllib3, tzdata, sqlparse, soupsieve, PyYAML, pycryptodome, psycopg2, psycopg-binary, idna, charset-normalizer, certifi, asgiref, aiofiles, requests, Django, beautifulsoup4, django-polymorphic, django-bootstrap5, django-bootstrap4, django-bootstrap3, build-django, Naked
#0 91.15 Running setup.py install for psycopg2: started
#0 91.31 Running setup.py install for psycopg2: finished with status 'error'
#0 91.31 error: subprocess-exited-with-error
#0 91.31
#0 91.31 × Running setup.py install for psycopg2 did not run successfully.
#0 91.31 │ exit code: 1
#0 91.31 ╰─> [33 lines of output]
#0 91.31 running install
#0 91.31 running build
#0 91.31 running build_py
#0 91.31 creating build
#0 91.31 creating build/lib.linux-x86_64-3.9
#0 91.31 creating build/lib.linux-x86_64-3.9/psycopg2
#0 91.31 copying lib/errorcodes.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 91.31 copying lib/pool.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 91.31 copying lib/errors.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 91.31 copying lib/sql.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 91.31 copying lib/tz.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 91.31 copying lib/_range.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 91.31 copying lib/extensions.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 91.31 copying lib/__init__.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 91.31 copying lib/extras.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 91.31 copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 91.31 copying lib/_json.py -> build/lib.linux-x86_64-3.9/psycopg2
#0 91.31 running build_ext
#0 91.31 building 'psycopg2._psycopg' extension
#0 91.31 creating build/temp.linux-x86_64-3.9
#0 91.31 creating build/temp.linux-x86_64-3.9/psycopg
#0 91.31 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_VERSION=2.9.5 (dt dec pq3 ext lo64) -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=110018 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/usr/local/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/11/server -I/usr/include/libxml2 -I/usr/include/mit-krb5 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_asis.o -Wdeclaration-after-statement
#0 91.31
#0 91.31 It appears you are missing some prerequisite to build the package from source.
#0 91.31
#0 91.31 You may install a binary package by installing 'psycopg2-binary' from PyPI.
#0 91.31 If you want to install psycopg2 from source, please install the packages
#0 91.31 required for the build and try again.
#0 91.31
#0 91.31 For further information please check the 'doc/src/install.rst' file (also at
#0 91.31 <https://www.psycopg.org/docs/install.html>).
#0 91.31
#0 91.31 error: command 'gcc' failed: No such file or directory
#0 91.31 [end of output]
#0 91.31
#0 91.31 note: This error originates from a subprocess, and is likely not a problem with pip.
#0 91.32 error: legacy-install-failure
#0 91.32
#0 91.32 × Encountered error while trying to install package.
#0 91.32 ╰─> psycopg2
#0 91.32
#0 91.32 note: This is an issue with the package mentioned above, not pip.
#0 91.32 hint: See above for output from the failure.
------
failed to solve: executor failed running [/bin/sh -c pip install --upgrade pip && pip install -r requirements.txt]: exit code: 1
this is my 'docker-compose.yml'
version: '3'
services:
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- localhost
localhost:
image: postgres:10
environment:
- POSTGRES_USER=****
- POSTGRES_PASSWORD=*****
- POSTGRES_DB=*****
volumes:
- postgres_data:/var/lib/postgresql/data/
volumes:
postgres_data:
this is my requirements.txt
aiofiles==22.1.0
asgiref==3.5.2
beautifulsoup4==4.11.1
build-django==2.1.0
certifi==2022.9.24
charset-normalizer==2.1.1
Django==4.1.2
django-bootstrap3==22.1
django-bootstrap4==22.3
django-bootstrap5==22.2
django-polymorphic==3.1.0
idna==3.4
Naked==0.1.31
psycopg-binary==3.1.8
psycopg2
pycryptodome==3.15.0
PyYAML==6.0
requests==2.28.1
shellescape==3.8.1
soupsieve==2.3.2.post1
sqlparse==0.4.3
tzdata==2022.4
urllib3==1.26.12
having problems installing web3 package in Pycharm. I am old and clueless when it comes to package installations. The same errors occur either through pip install or interpreter settings/add package. I do not know what else to try and stackoverflow is giving me an error because it says I need to add more details.
OS: Linux Mint 20.1
Pycharm: 2021.1.3
Python: 3.8.10
This answer worked:
"You have to install apt install python3.8-dev –
furas
"
Collecting web3
Using cached web3-5.28.0-py3-none-any.whl (499 kB)
Collecting eth-utils<2.0.0,>=1.9.5
Using cached eth_utils-1.10.0-py3-none-any.whl (24 kB)
Collecting aiohttp<4,>=3.7.4.post0
Using cached aiohttp-3.8.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.3 MB)
Collecting lru-dict<2.0.0,>=1.1.6
Using cached lru-dict-1.1.7.tar.gz (10 kB)
Preparing metadata (setup.py) ... done
Collecting hexbytes<1.0.0,>=0.1.0
Using cached hexbytes-0.2.2-py3-none-any.whl (6.1 kB)
Requirement already satisfied: requests<3.0.0,>=2.16.0 in /usr/lib/python3/dist-packages (from web3) (2.22.0)
Collecting eth-abi<3.0.0,>=2.0.0b6
Using cached eth_abi-2.1.1-py3-none-any.whl (27 kB)
Collecting ipfshttpclient==0.8.0a2
Using cached ipfshttpclient-0.8.0a2-py3-none-any.whl (82 kB)
Collecting eth-account<0.6.0,>=0.5.7
Using cached eth_account-0.5.7-py3-none-any.whl (101 kB)
Collecting jsonschema<4.0.0,>=3.2.0
Using cached jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
Collecting protobuf<4,>=3.10.0
Using cached protobuf-3.19.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB)
Collecting eth-hash[pycryptodome]<1.0.0,>=0.2.0
Using cached eth_hash-0.3.2-py3-none-any.whl (8.8 kB)
Collecting eth-typing<3.0.0,>=2.0.0
Using cached eth_typing-2.3.0-py3-none-any.whl (6.2 kB)
Collecting websockets<10,>=9.1
Using cached websockets-9.1-cp38-cp38-manylinux2010_x86_64.whl (102 kB)
Collecting multiaddr>=0.0.7
Using cached multiaddr-0.0.9-py2.py3-none-any.whl (16 kB)
Collecting attrs>=17.3.0
Using cached attrs-21.4.0-py2.py3-none-any.whl (60 kB)
Collecting frozenlist>=1.1.1
Using cached frozenlist-1.3.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (158 kB)
Collecting async-timeout<5.0,>=4.0.0a3
Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting yarl<2.0,>=1.0
Using cached yarl-1.7.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (308 kB)
Collecting charset-normalizer<3.0,>=2.0
Using cached charset_normalizer-2.0.12-py3-none-any.whl (39 kB)
Collecting aiosignal>=1.1.2
Using cached aiosignal-1.2.0-py3-none-any.whl (8.2 kB)
Collecting multidict<7.0,>=4.5
Using cached multidict-6.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (121 kB)
Collecting parsimonious<0.9.0,>=0.8.0
Using cached parsimonious-0.8.1-py3-none-any.whl
Collecting eth-rlp<2,>=0.1.2
Using cached eth_rlp-0.3.0-py3-none-any.whl (5.0 kB)
Collecting eth-keys<0.4.0,>=0.3.4
Using cached eth_keys-0.3.4-py3-none-any.whl (21 kB)
Collecting rlp<3,>=1.0.0
Using cached rlp-2.0.1-py2.py3-none-any.whl (20 kB)
Collecting bitarray<1.3.0,>=1.2.1
Using cached bitarray-1.2.2.tar.gz (48 kB)
Preparing metadata (setup.py) ... done
Collecting eth-keyfile<0.6.0,>=0.5.0
Using cached eth_keyfile-0.5.1-py3-none-any.whl (8.3 kB)
Collecting pycryptodome<4,>=3.6.6
Using cached pycryptodome-3.14.1-cp35-abi3-manylinux2010_x86_64.whl (2.0 MB)
Collecting cytoolz<1.0.0,>=0.10.1
Using cached cytoolz-0.11.2.tar.gz (481 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: six>=1.11.0 in /usr/lib/python3/dist-packages (from jsonschema<4.0.0,>=3.2.0->web3) (1.14.0)
Collecting pyrsistent>=0.14.0
Using cached pyrsistent-0.18.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (119 kB)
Requirement already satisfied: setuptools in ./venv/lib/python3.8/site-packages (from jsonschema<4.0.0,>=3.2.0->web3) (60.9.3)
Requirement already satisfied: toolz>=0.8.0 in ./venv/lib/python3.8/site-packages (from cytoolz<1.0.0,>=0.10.1->eth-utils<2.0.0,>=1.9.5->web3) (0.11.2)
Collecting eth-rlp<2,>=0.1.2
Using cached eth_rlp-0.2.1-py3-none-any.whl (5.0 kB)
Requirement already satisfied: varint in ./venv/lib/python3.8/site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.8.0a2->web3) (1.0.2)
Collecting base58
Using cached base58-2.1.1-py3-none-any.whl (5.6 kB)
Requirement already satisfied: netaddr in ./venv/lib/python3.8/site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.8.0a2->web3) (0.8.0)
Requirement already satisfied: idna>=2.0 in /usr/lib/python3/dist-packages (from yarl<2.0,>=1.0->aiohttp<4,>=3.7.4.post0->web3) (2.8)
Building wheels for collected packages: lru-dict, bitarray, cytoolz
Building wheel for lru-dict (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
running bdist_wheel
running build
running build_ext
building 'lru' extension
creating build
creating build/temp.linux-x86_64-3.8
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 -fPIC -I/home/bs/PycharmProjects/SOLIDITY_TESTING/venv/include -I/usr/include/python3.8 -c lru.c -o build/temp.linux-x86_64-3.8/lru.o
lru.c:1:10: fatal error: Python.h: No such file or directory
1 | #include <Python.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 lru-dict
Running setup.py clean for lru-dict
Building wheel for bitarray (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [20 lines of output]
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/bitarray
copying bitarray/test_bitarray.py -> build/lib.linux-x86_64-3.8/bitarray
copying bitarray/__init__.py -> build/lib.linux-x86_64-3.8/bitarray
copying bitarray/test_util.py -> build/lib.linux-x86_64-3.8/bitarray
copying bitarray/util.py -> build/lib.linux-x86_64-3.8/bitarray
running build_ext
building 'bitarray._bitarray' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/bitarray
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 -fPIC -I/home/bs/PycharmProjects/SOLIDITY_TESTING/venv/include -I/usr/include/python3.8 -c bitarray/_bitarray.c -o build/temp.linux-x86_64-3.8/bitarray/_bitarray.o
bitarray/_bitarray.c:12:10: fatal error: Python.h: No such file or directory
12 | #include "Python.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 bitarray
Running setup.py clean for bitarray
Building wheel for cytoolz (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [60 lines of output]
[1/5] Cythonizing cytoolz/utils.pyx
[2/5] Cythonizing cytoolz/dicttoolz.pyx
[3/5] Cythonizing cytoolz/functoolz.pyx
[4/5] Cythonizing cytoolz/itertoolz.pyx
[5/5] Cythonizing cytoolz/recipes.pyx
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/cytoolz
copying cytoolz/_version.py -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/__init__.py -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/_signatures.py -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/compatibility.py -> build/lib.linux-x86_64-3.8/cytoolz
creating build/lib.linux-x86_64-3.8/cytoolz/curried
copying cytoolz/curried/exceptions.py -> build/lib.linux-x86_64-3.8/cytoolz/curried
copying cytoolz/curried/__init__.py -> build/lib.linux-x86_64-3.8/cytoolz/curried
copying cytoolz/curried/operator.py -> build/lib.linux-x86_64-3.8/cytoolz/curried
copying cytoolz/dicttoolz.pyx -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/utils.pyx -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/recipes.pyx -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/itertoolz.pyx -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/functoolz.pyx -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/itertoolz.pxd -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/dicttoolz.pxd -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/utils.pxd -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/recipes.pxd -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/cpython.pxd -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/functoolz.pxd -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/__init__.pxd -> build/lib.linux-x86_64-3.8/cytoolz
creating build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_curried_toolzlike.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_serialization.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_functoolz.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_docstrings.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_recipes.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_dicttoolz.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_curried.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_dev_skip_test.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_utils.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_inspect_args.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_itertoolz.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_compatibility.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_signatures.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_none_safe.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_embedded_sigs.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/dev_skip_test.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_doctests.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_tlz.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
running build_ext
building 'cytoolz.dicttoolz' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/cytoolz
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 -fPIC -I/home/bs/PycharmProjects/SOLIDITY_TESTING/venv/include -I/usr/include/python3.8 -c cytoolz/dicttoolz.c -o build/temp.linux-x86_64-3.8/cytoolz/dicttoolz.o
cytoolz/dicttoolz.c:19:10: fatal error: Python.h: No such file or directory
19 | #include "Python.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 cytoolz
Running setup.py clean for cytoolz
Failed to build lru-dict bitarray cytoolz
Installing collected packages: lru-dict, bitarray, websockets, pyrsistent, pycryptodome, protobuf, parsimonious, multidict, hexbytes, frozenlist, eth-typing, eth-hash, cytoolz, charset-normalizer, base58, attrs, async-timeout, yarl, multiaddr, jsonschema, eth-utils, aiosignal, rlp, ipfshttpclient, eth-keys, eth-abi, aiohttp, eth-rlp, eth-keyfile, eth-account, web3
Running setup.py install for lru-dict ... error
error: subprocess-exited-with-error
× Running setup.py install for lru-dict did not run successfully.
│ exit code: 1
╰─> [14 lines of output]
running install
/home/bs/PycharmProjects/SOLIDITY_TESTING/venv/lib/python3.8/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_ext
building 'lru' extension
creating build
creating build/temp.linux-x86_64-3.8
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 -fPIC -I/home/bs/PycharmProjects/SOLIDITY_TESTING/venv/include -I/usr/include/python3.8 -c lru.c -o build/temp.linux-x86_64-3.8/lru.o
lru.c:1:10: fatal error: Python.h: No such file or directory
1 | #include <Python.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.
╰─> lru-dict
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
In error you can see
Python.h: No such file or directory
and it means it compiles some C/C++ code and it needs C/C++ headers for Python source code.
You have to install
apt install python3.8-dev
Im trying to run the below Dockerfile using docker-compose.
I searched around but I couldnt find a solution on how to install cffi with python:3.9-alpine.
I also read this post which states that pip 21.2.4 or greater can be a possible solution but it didn't work out form me
https://www.pythonfixing.com/2021/09/fixed-why-i-getting-this-error-while.html
Docker file
FROM python:3.9-alpine
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
COPY ./requirements.txt .
RUN apk add --update --no-cache postgresql-client
RUN apk add --update --no-cache --virtual .tmp-build-deps \
gcc libc-dev linux-headers postgresql-dev
RUN pip3 install --upgrade pip && pip3 install -r /requirements.txt
RUN apk del .tmp-build-deps
RUN mkdir /app
WORKDIR /app
COPY . /app
RUN adduser -D user
USER user
This is the requirements.txt file.
asgiref==3.5.0
backports.zoneinfo==0.2.1
certifi==2021.10.8
cffi==1.15.0
cfgv==3.3.1
...
Error message:
process-exited-with-error
#9 47.99
#9 47.99 × Running setup.py install for cffi did not run successfully.
#9 47.99 │ exit code: 1
#9 47.99 ╰─> [58 lines of output]
#9 47.99 Package libffi was not found in the pkg-config search path.
#9 47.99 Perhaps you should add the directory containing `libffi.pc'
#9 47.99 to the PKG_CONFIG_PATH environment variable
#9 47.99 Package 'libffi', required by 'virtual:world', not found
#9 47.99 Package libffi was not found in the pkg-config search path.
#9 47.99 Perhaps you should add the directory containing `libffi.pc'
#9 47.99 to the PKG_CONFIG_PATH environment variable
#9 47.99 Package 'libffi', required by 'virtual:world', not found
#9 47.99 Package libffi was not found in the pkg-config search path.
#9 47.99 Perhaps you should add the directory containing `libffi.pc'
#9 47.99 to the PKG_CONFIG_PATH environment variable
#9 47.99 Package 'libffi', required by 'virtual:world', not found
#9 47.99 Package libffi was not found in the pkg-config search path.
#9 47.99 Perhaps you should add the directory containing `libffi.pc'
#9 47.99 to the PKG_CONFIG_PATH environment variable
#9 47.99 Package 'libffi', required by 'virtual:world', not found
#9 47.99 Package libffi was not found in the pkg-config search path.
#9 47.99 Perhaps you should add the directory containing `libffi.pc'
#9 47.99 to the PKG_CONFIG_PATH environment variable
#9 47.99 Package 'libffi', required by 'virtual:world', not found
#9 47.99 running install
#9 47.99 running build
#9 47.99 running build_py
#9 47.99 creating build
#9 47.99 creating build/lib.linux-aarch64-3.9
#9 47.99 creating build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/__init__.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/cffi_opcode.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/commontypes.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/vengine_gen.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/vengine_cpy.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/backend_ctypes.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/api.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/ffiplatform.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/verifier.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/error.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/setuptools_ext.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/lock.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/recompiler.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/pkgconfig.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/cparser.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/model.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/_cffi_include.h -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/parse_c_type.h -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/_embedding.h -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/_cffi_errors.h -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 warning: build_py: byte-compiling is disabled, skipping.
#9 47.99
#9 47.99 running build_ext
#9 47.99 building '_cffi_backend' extension
#9 47.99 creating build/temp.linux-aarch64-3.9
#9 47.99 creating build/temp.linux-aarch64-3.9/c
#9 47.99 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.9 -c c/_cffi_backend.c -o build/temp.linux-aarch64-3.9/c/_cffi_backend.o
#9 47.99 c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
#9 47.99 15 | #include <ffi.h>
#9 47.99 | ^~~~~~~
#9 47.99 compilation terminated.
#9 47.99 error: command '/usr/bin/gcc' failed with exit code 1
#9 47.99 [end of output]
#9 47.99
#9 47.99 note: This error originates from a subprocess, and is likely not a problem with pip.
#9 47.99 error: legacy-install-failure
#9 47.99
#9 47.99 × Encountered error while trying to install package.
#9 47.99 ╰─> cffi
#9 47.99
#9 47.99 note: This is an issue with the package mentioned above, not pip.
#9 47.99 hint: See above for output from the failure.
The libffi library is missing.
Add it to your dockerfile:
RUN apk add libffi-dev
#Klaus D.'s comment helped a lot.
I updated Dockerfile:
RUN apk add --update --no-cache --virtual .tmp-build-deps \
gcc libc-dev linux-headers postgresql-dev \
&& apk add libffi-dev
If you are installing your Python packages running on openjdk:11.0.11-jre-slim-buster Docker container, and you encounter this problem. Add the commands below to build your docker image.
RUN apt-get install -y build-essential libssl-dev libffi-dev python-dev
RUN python3 -m pip install --upgrade pip
COPY ./requirements.txt /
I'm having problem building Docker image from aws-mwaa-local-runner repository (using their release v2.0.2). Apparently it has problem with Flask-OpenID 1.2.5 (see output below) but I'm lost as to how to resolve it.
For the record, I tried this with Docker for Windows version 20.10.12, Ubuntu distro running with Windows Subsystem for Linux version 2, Kernel version 5.10.16.
=> [ 7/13] RUN chmod u+x /bootstrap.sh && /bootstrap.sh
...
#11 67.25 Collecting Flask-OpenID<2,>=1.2.5
#11 67.30 Downloading Flask-OpenID-1.2.5.tar.gz (43 kB)
#11 67.32 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 43.4/43.4 KB 3.2 MB/s eta 0:00:00
#11 67.33 Preparing metadata (setup.py): started
#11 67.51 Preparing metadata (setup.py): finished with status 'error'
#11 67.52 error: subprocess-exited-with-error
#11 67.52
#11 67.52 × python setup.py egg_info did not run successfully.
#11 67.52 │ exit code: 1
#11 67.52 ╰─> [1 lines of output]
#11 67.52 error in Flask-OpenID setup command: use_2to3 is invalid.
#11 67.52 [end of output]
#11 67.52
#11 67.52 note: This error originates from a subprocess, and is likely not a problem with pip.
#11 67.52 error: metadata-generation-failed
#11 67.52
#11 67.52 × Encountered error while generating package metadata.
#11 67.52 ╰─> See above for output.
#11 67.52
#11 67.52 note: This is an issue with the package mentioned above, not pip.
#11 67.52 hint: See above for details.
------
executor failed running [/bin/sh -c chmod u+x /bootstrap.sh && /bootstrap.sh]: exit code: 1
For the record, I was able to solve this issue by changing Flask-OpenID version in /docker/config/requirements.txt and /docker/config/constraints.txt from 1.2.5 to 1.3.0 and finished building the image successfully.