Installation with pip fails in a virtual environment. Have tried now on two different machines with same result:
Building wheels for collected packages: py-bcrypt
Building wheel for py-bcrypt (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for py-bcrypt (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [44 lines of output]
running bdist_wheel
running build
running build_py
creating build/lib.linux-x86_64-cpython-312/bcrypt
copying bcrypt/__init__.py -> build/lib.linux-x86_64-cpython-312/bcrypt
running build_ext
building 'bcrypt._bcrypt' extension
creating build/temp.linux-x86_64-cpython-312/bcrypt
x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -fPIC -I/home/davec/gits/notebooks/venv/include -I/usr/include/python3.12 -c bcrypt/bcrypt.c -o build/temp.linux-x86_64-cpython-312/bcrypt/bcrypt.o
bcrypt/bcrypt.c: In function ‘encode_salt’:
bcrypt/bcrypt.c:139:38: warning: ‘__builtin___snprintf_chk’ output may be truncated before the last format character [-Wformat-truncation=]
139 | snprintf(salt + 4, 4, "%2.2u$", logr);
| ^
In file included from /usr/include/stdio.h:980,
from bcrypt/bcrypt.c:48:
In function ‘snprintf’,
inlined from ‘encode_salt’ at bcrypt/bcrypt.c:139:2:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:54:10: note: ‘__builtin___snprintf_chk’ output between 4 and 5 bytes into a destination of size 4
54 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56 | __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~
bcrypt/bcrypt.c: In function ‘pybc_bcrypt’:
bcrypt/bcrypt.c:249:43: warning: ‘__builtin___snprintf_chk’ output may be truncated before the last format character [-Wformat-truncation=]
249 | snprintf(encrypted + i, 4, "%2.2u$", logr);
| ^
In function ‘snprintf’,
inlined from ‘pybc_bcrypt’ at bcrypt/bcrypt.c:249:2:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:54:10: note: ‘__builtin___snprintf_chk’ output between 4 and 5 bytes into a destination of size 4
54 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56 | __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~
x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -fPIC -I/home/davec/gits/notebooks/venv/include -I/usr/include/python3.12 -c bcrypt/bcrypt_pbkdf.c -o build/temp.linux-x86_64-cpython-312/bcrypt/bcrypt_pbkdf.o
x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -fPIC -I/home/davec/gits/notebooks/venv/include -I/usr/include/python3.12 -c bcrypt/bcrypt_python.c -o build/temp.linux-x86_64-cpython-312/bcrypt/bcrypt_python.o
bcrypt/bcrypt_python.c:18:10: fatal error: Python.h: No such file or directory
18 | #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 py-bcrypt
Failed to build py-bcrypt
error: failed-wheel-build-for-install
× Failed to build installable wheels for some pyproject.toml based projects
╰─> py-bcrypt
Installation with pip fails in a virtual environment. Have tried now on two different machines with same result: