Closed arkin0x closed 1 year ago
I tried this: https://stackoverflow.com/a/51127206
python3 -m venv .
. bin/activate
pip install wheel (never had to do this on, say, Arch Linux)
pip install Flask
Did not help.
I then found this: https://stackoverflow.com/a/63887705
I realized that psycopg2 is part of the requirements.txt file. Since I already installed the binary, I removed it from requirements.txt and retried pip install -r requirements.txt
. This time, it finished successfully.
I then ran into similar errors when trying to run pip install ./monstr
. I tried removing psycopg2 from the ./monstr/requirements.txt file but it had no effect. Here is the output:
/mnt/c/www/nostr/monstr_terminal# pip install ./monstr
Processing ./monstr
Requirement already satisfied: aioconsole>=0.6.0 in ./venv/lib/python3.8/site-packages (from monstr==0.1.2) (0.6.1)
Requirement already satisfied: aiohttp>=3.8.4 in ./venv/lib/python3.8/site-packages (from monstr==0.1.2) (3.8.4)
Requirement already satisfied: aiosqlite>=0.18.0 in ./venv/lib/python3.8/site-packages (from monstr==0.1.2) (0.19.0)
Requirement already satisfied: bech32>=1.2.0 in ./venv/lib/python3.8/site-packages (from monstr==0.1.2) (1.2.0)
Requirement already satisfied: cachetools>=5.3.0 in ./venv/lib/python3.8/site-packages (from monstr==0.1.2) (5.3.1)
Requirement already satisfied: cryptography>=39.0.1 in ./venv/lib/python3.8/site-packages (from monstr==0.1.2) (41.0.1)
Collecting psycopg2>=2.9.6
Using cached psycopg2-2.9.6.tar.gz (383 kB)
Requirement already satisfied: secp256k1>=0.14.0 in ./venv/lib/python3.8/site-packages (from monstr==0.1.2) (0.14.0)
Requirement already satisfied: aiosignal>=1.1.2 in ./venv/lib/python3.8/site-packages (from aiohttp>=3.8.4->monstr==0.1.2) (1.3.1)
Requirement already satisfied: yarl<2.0,>=1.0 in ./venv/lib/python3.8/site-packages (from aiohttp>=3.8.4->monstr==0.1.2) (1.9.2)
Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in ./venv/lib/python3.8/site-packages (from aiohttp>=3.8.4->monstr==0.1.2) (4.0.2)
Requirement already satisfied: frozenlist>=1.1.1 in ./venv/lib/python3.8/site-packages (from aiohttp>=3.8.4->monstr==0.1.2) (1.3.3)
Requirement already satisfied: attrs>=17.3.0 in ./venv/lib/python3.8/site-packages (from aiohttp>=3.8.4->monstr==0.1.2) (23.1.0)
Requirement already satisfied: multidict<7.0,>=4.5 in ./venv/lib/python3.8/site-packages (from aiohttp>=3.8.4->monstr==0.1.2) (6.0.4)
Requirement already satisfied: charset-normalizer<4.0,>=2.0 in ./venv/lib/python3.8/site-packages (from aiohttp>=3.8.4->monstr==0.1.2) (3.1.0)
Requirement already satisfied: cffi>=1.12 in ./venv/lib/python3.8/site-packages (from cryptography>=39.0.1->monstr==0.1.2) (1.15.1)
Requirement already satisfied: idna>=2.0 in ./venv/lib/python3.8/site-packages (from yarl<2.0,>=1.0->aiohttp>=3.8.4->monstr==0.1.2) (3.4)
Requirement already satisfied: pycparser in ./venv/lib/python3.8/site-packages (from cffi>=1.12->cryptography>=39.0.1->monstr==0.1.2) (2.21)
Building wheels for collected packages: monstr, psycopg2
Building wheel for monstr (setup.py) ... done
Created wheel for monstr: filename=monstr-0.1.2-py3-none-any.whl size=89858 sha256=94f4bd944c07cf40a02efdec3346a2b379a5584ca24c5f45ac47d7459de5c47f
Stored in directory: /tmp/pip-ephem-wheel-cache-e_3qk9je/wheels/7f/bc/5e/a0832f2c39102a5c2257b69b1d8d593dcf823c8c630ec70e01
Building wheel for psycopg2 (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /mnt/c/www/nostr/monstr_terminal/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jvmxi2il/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jvmxi2il/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-3atw8ji_
cwd: /tmp/pip-install-jvmxi2il/psycopg2/
Complete output (52 lines):
/mnt/c/www/nostr/monstr_terminal/venv/lib/python3.8/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg`
!!
********************************************************************************
The license_file parameter is deprecated, use license_files instead.
By 2023-Oct-30, you need to update your project and remove deprecated calls
or your builds will no longer be supported.
See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
********************************************************************************
!!
parsed = self.parsers.get(option_name, lambda x: x)(value)
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-38
creating build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-cpython-38/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-cpython-38
creating build/temp.linux-x86_64-cpython-38/psycopg
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 "-DPSYCOPG_VERSION=2.9.6 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=120015 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/mnt/c/www/nostr/monstr_terminal/venv/include -I/usr/include/python3.8 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -I/usr/include/libxml2 -I/usr/include/mit-krb5 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-cpython-38/psycopg/adapter_asis.o -Wdeclaration-after-statement
In file included from psycopg/adapter_asis.c:28:
./psycopg/psycopg.h:35:10: fatal error: Python.h: No such file or directory
35 | #include <Python.h>
| ^~~~~~~~~~
compilation terminated.
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for psycopg2
Running setup.py clean for psycopg2
Successfully built monstr
Failed to build psycopg2
Installing collected packages: psycopg2, monstr
Running setup.py install for psycopg2 ... error
ERROR: Command errored out with exit status 1:
command: /mnt/c/www/nostr/monstr_terminal/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jvmxi2il/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jvmxi2il/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-zktx0u42/install-record.txt --single-version-externally-managed --compile --install-headers /mnt/c/www/nostr/monstr_terminal/venv/include/site/python3.8/psycopg2
cwd: /tmp/pip-install-jvmxi2il/psycopg2/
Complete output (65 lines):
/mnt/c/www/nostr/monstr_terminal/venv/lib/python3.8/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg`
!!
********************************************************************************
The license_file parameter is deprecated, use license_files instead.
By 2023-Oct-30, you need to update your project and remove deprecated calls
or your builds will no longer be supported.
See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
********************************************************************************
!!
parsed = self.parsers.get(option_name, lambda x: x)(value)
running install
/mnt/c/www/nostr/monstr_terminal/venv/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` directly.
Instead, use pypa/build, pypa/installer or other
standards-based tools.
See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
********************************************************************************
!!
self.initialize_options()
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-38
creating build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-cpython-38/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-cpython-38/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-cpython-38
creating build/temp.linux-x86_64-cpython-38/psycopg
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 "-DPSYCOPG_VERSION=2.9.6 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=120015 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/mnt/c/www/nostr/monstr_terminal/venv/include -I/usr/include/python3.8 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -I/usr/include/libxml2 -I/usr/include/mit-krb5 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-cpython-38/psycopg/adapter_asis.o -Wdeclaration-after-statement
In file included from psycopg/adapter_asis.c:28:
./psycopg/psycopg.h:35:10: fatal error: Python.h: No such file or directory
35 | #include <Python.h>
| ^~~~~~~~~~
compilation terminated.
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /mnt/c/www/nostr/monstr_terminal/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jvmxi2il/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jvmxi2il/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-zktx0u42/install-record.txt --single-version-externally-managed --compile --install-headers /mnt/c/www/nostr/monstr_terminal/venv/include/site/python3.8/psycopg2 Check the logs for full command output.
Hi, Is it because it uses the setup.py rather than requirements.txt? Maybe you could try removing psycopg2 from there and doing the pip install.
FYI psycopg2 is only used if setting postgres as relay.
Sent from ProtonMail mobile
-------- Original Message -------- On 29 Jun 2023, 22:39, arkin0x wrote:
I tried this: https://stackoverflow.com/a/51127206
python3 -m venv . . bin/activate pip install wheel (never had to do this on, say, Arch Linux) pip install Flask
Did not help.
I then found this: https://stackoverflow.com/a/63887705
I realized that psycopg2 is part of the requirements.txt file. Since I already installed the binary, I removed it from requirements.txt and retried pip install -r requirements.txt. This time, it finished successfully.
I then ran into similar errors when trying to run pip install ./monstr. I tried removing psycopg2 from the ./monstr/requirements.txt file but it had no effect. Here is the output:
/mnt/c/www/nostr/monstr_terminal# pip install ./monstr Processing ./monstr Requirement already satisfied: aioconsole
=0.6.0
in
./venv/lib/python3.8/site-packages (from monstr==0.1.2) (0.6.1) Requirement already satisfied: aiohttp
=3.8.4
in
./venv/lib/python3.8/site-packages (from monstr==0.1.2) (3.8.4) Requirement already satisfied: aiosqlite
=0.18.0
in
./venv/lib/python3.8/site-packages (from monstr==0.1.2) (0.19.0) Requirement already satisfied: bech
32>
=1.2.0
in
./venv/lib/python3.8/site-packages (from monstr==0.1.2) (1.2.0) Requirement already satisfied: cachetools
=5.3.0
in
./venv/lib/python3.8/site-packages (from monstr==0.1.2) (5.3.1) Requirement already satisfied: cryptography
=39.0.1
in
./venv/lib/python3.8/site-packages (from monstr==0.1.2) (41.0.1)
Collecting psycopg
2>
=2.9.6 Using cached psycopg2-2.9.6.tar.gz (383 kB) Requirement already satisfied: secp256k
1>
=0.14.0
in
./venv/lib/python3.8/site-packages (from monstr==0.1.2) (0.14.0) Requirement already satisfied: aiosignal
=1.1.2
in
./venv/lib/python3.8/site-packages (from aiohttp
=3.8.4-
monstr==0.1.2) (1.3.1) Requirement already satisfied: yarl
<
2.0,
=1.0
in
./venv/lib/python3.8/site-packages (from aiohttp
=3.8.4-
monstr==0.1.2) (1.9.2) Requirement already satisfied: async-timeout
<
5.0,
=4.0.0a3
in
./venv/lib/python3.8/site-packages (from aiohttp
=3.8.4-
monstr==0.1.2) (4.0.2) Requirement already satisfied: frozenlist
=1.1.1
in
./venv/lib/python3.8/site-packages (from aiohttp
=3.8.4-
monstr==0.1.2) (1.3.3) Requirement already satisfied: attrs
=17.3.0
in
./venv/lib/python3.8/site-packages (from aiohttp
=3.8.4-
monstr==0.1.2) (23.1.0) Requirement already satisfied: multidict
<
7.0,
=4.5
in
./venv/lib/python3.8/site-packages (from aiohttp
=3.8.4-
monstr==0.1.2) (6.0.4) Requirement already satisfied: charset-normalizer
<
4.0,
=2.0
in
./venv/lib/python3.8/site-packages (from aiohttp
=3.8.4-
monstr==0.1.2) (3.1.0) Requirement already satisfied: cffi
=1.12
in
./venv/lib/python3.8/site-packages (from cryptography
=39.0.1-
monstr==0.1.2) (1.15.1) Requirement already satisfied: idna
=2.0
in
./venv/lib/python3.8/site-packages (from yarl
<
2.0,
=1.0-
aiohttp
=3.8.4-
monstr==0.1.2) (3.4) Requirement already satisfied: pycparser
in
./venv/lib/python3.8/site-packages (from cffi
=1.12-
cryptography
=39.0.1-
monstr==0.1.2) (2.21) Building wheels
for
collected packages: monstr, psycopg2 Building wheel
for
monstr (setup.py) ...
done
Created wheel
for
monstr: filename=monstr-0.1.2-py3-none-any.whl size=89858 sha256=94f4bd944c07cf40a02efdec3346a2b379a5584ca24c5f45ac47d7459de5c47f Stored
in
directory: /tmp/pip-ephem-wheel-cache-e_3qk9je/wheels/7f/bc/5e/a0832f2c39102a5c2257b69b1d8d593dcf823c8c630ec70e01 Building wheel
for
psycopg2 (setup.py) ... error ERROR: Command errored out with
exit
status 1: command: /mnt/c/www/nostr/monstr_terminal/venv/bin/python3 -u -c
'
import sys, setuptools, tokenize; sys.argv[0] =
'
"
'
"
'
/tmp/pip-install-jvmxi2il/psycopg2/setup.py
'
"
'
"
'
; file=
'
"
'
"
'
/tmp/pip-install-jvmxi2il/psycopg2/setup.py
'
"
'
"
'
;f=getattr(tokenize,
'
"
'
"
'
open
'
"
'
"
'
, open)(file);code=f.read().replace(
'
"
'
"
'
\r\n
'
"
'
"
'
,
'
"
'
"
'
\n
'
"
'
"
'
);f.close();exec(compile(code, file,
'
"
'
"
'
exec
'
"
'
"
'
))
'
bdistwheel -d /tmp/pip-wheel-3atw8ji cwd: /tmp/pip-install-jvmxi2il/psycopg2/ Complete output (52 lines): /mnt/c/www/nostr/monstr_terminal/venv/lib/python3.8/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config
in
`
setup.cfg
`
!!
The license_file parameter is deprecated, use license_files instead.
By 2023-Oct-30, you need to update your project and remove deprecated calls or your builds will no longer be supported. See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html
for
details.
!!
parsed = self.parsers.get(option_name, lambda x: x)(value) running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-cpython-38 creating build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/errorcodes.py -
build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/pool.py -
build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/errors.py -
build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/sql.py -
build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/tz.py -
build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/_range.py -
build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/extensions.py -
build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/init.py -
build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/extras.py -
build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/_ipaddress.py -
build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/_json.py -
build/lib.linux-x86_64-cpython-38/psycopg2 running build_ext building
'
psycopg2._psycopg
'
extension creating build/temp.linux-x86_64-cpython-38 creating build/temp.linux-x86_64-cpython-38/psycopg 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
"
-DPSYCOPG_VERSION=2.9.6 (dt dec pq3 ext lo64)
"
-DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=120015 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/mnt/c/www/nostr/monstr_terminal/venv/include -I/usr/include/python3.8 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -I/usr/include/libxml2 -I/usr/include/mit-krb5 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-cpython-38/psycopg/adapter_asis.o -Wdeclaration-after-statement In file included from psycopg/adapter_asis.c:28: ./psycopg/psycopg.h:35:10: fatal error: Python.h: No such file or directory 35
|
#
include
|
^
~~~~~ compilation terminated.It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing
'
psycopg2-binary
'
from PyPI. If you want to install psycopg2 from source, please install the packages required
for
the build and try again.
For further information please check the
'
doc/src/install.rst
'
file (also at
<
https://www.psycopg.org/docs/install.html
).
error:
command
'
/usr/bin/x86_64-linux-gnu-gcc
'
failed with
exit
code 1
ERROR: Failed building wheel
for
psycopg2 Running setup.py clean
for
psycopg2 Successfully built monstr Failed to build psycopg2 Installing collected packages: psycopg2, monstr Running setup.py install
for
psycopg2 ... error ERROR: Command errored out with
exit
status 1: command: /mnt/c/www/nostr/monstr_terminal/venv/bin/python3 -u -c
'
import sys, setuptools, tokenize; sys.argv[0] =
'
"
'
"
'
/tmp/pip-install-jvmxi2il/psycopg2/setup.py
'
"
'
"
'
; file=
'
"
'
"
'
/tmp/pip-install-jvmxi2il/psycopg2/setup.py
'
"
'
"
'
;f=getattr(tokenize,
'
"
'
"
'
open
'
"
'
"
'
, open)(file);code=f.read().replace(
'
"
'
"
'
\r\n
'
"
'
"
'
,
'
"
'
"
'
\n
'
"
'
"
'
);f.close();exec(compile(code, file,
'
"
'
"
'
exec
'
"
'
"
'
))
'
install --record /tmp/pip-record-zktx0u42/install-record.txt --single-version-externally-managed --compile --install-headers /mnt/c/www/nostr/monstr_terminal/venv/include/site/python3.8/psycopg2 cwd: /tmp/pip-install-jvmxi2il/psycopg2/ Complete output (65 lines): /mnt/c/www/nostr/monstr_terminal/venv/lib/python3.8/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config
in
`
setup.cfg
`
!!
The license_file parameter is deprecated, use license_files instead.
By 2023-Oct-30, you need to update your project and remove deprecated calls or your builds will no longer be supported. See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html
for
details.
!!
parsed = self.parsers.get(option_name, lambda x: x)(value) running install /mnt/c/www/nostr/monstr_terminal/venv/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!
Please avoid running
`
`
setup.py
`
`
directly. Instead, use pypa/build, pypa/installer or other standards-based tools.
See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html
for
details.
!!
self.initialize_options
() running build running build_py creating build creating build/lib.linux-x86_64-cpython-38 creating build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/errorcodes.py -
build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/pool.py -
build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/errors.py -
build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/sql.py -
build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/tz.py -
build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/_range.py -
build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/extensions.py -
build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/init.py -
build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/extras.py -
build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/_ipaddress.py -
build/lib.linux-x86_64-cpython-38/psycopg2 copying lib/_json.py -
build/lib.linux-x86_64-cpython-38/psycopg2 running build_ext building
'
psycopg2._psycopg
'
extension creating build/temp.linux-x86_64-cpython-38 creating build/temp.linux-x86_64-cpython-38/psycopg 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
"
-DPSYCOPG_VERSION=2.9.6 (dt dec pq3 ext lo64)
"
-DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=120015 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/mnt/c/www/nostr/monstr_terminal/venv/include -I/usr/include/python3.8 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -I/usr/include/libxml2 -I/usr/include/mit-krb5 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-cpython-38/psycopg/adapter_asis.o -Wdeclaration-after-statement In file included from psycopg/adapter_asis.c:28: ./psycopg/psycopg.h:35:10: fatal error: Python.h: No such file or directory 35
|
#
include
|
^
~~~~~ compilation terminated.It appears you are missing some prerequisite to build the package from source. You may install a binary package by installing
'
psycopg2-binary
'
from PyPI. If you want to install psycopg2 from source, please install the packages required
for
the build and try again.
For further information please check the
'
doc/src/install.rst
'
file (also at
<
https://www.psycopg.org/docs/install.html
).
error:
command
'
/usr/bin/x86_64-linux-gnu-gcc
'
failed with
exit
code 1
ERROR: Command errored out with
exit
status 1: /mnt/c/www/nostr/monstr_terminal/venv/bin/python3 -u -c
'
import sys, setuptools, tokenize; sys.argv[0] =
'
"
'
"
'
/tmp/pip-install-jvmxi2il/psycopg2/setup.py
'
"
'
"
'
; file=
'
"
'
"
'
/tmp/pip-install-jvmxi2il/psycopg2/setup.py
'
"
'
"
'
;f=getattr(tokenize,
'
"
'
"
'
open
'
"
'
"
'
, open)(file);code=f.read().replace(
'
"
'
"
'
\r\n
'
"
'
"
'
,
'
"
'
"
'
\n
'
"
'
"
'
);f.close();exec(compile(code, file,
'
"
'
"
'
exec
'
"
'
"
'
))
'
install --record /tmp/pip-record-zktx0u42/install-record.txt --single-version-externally-managed --compile --install-headers /mnt/c/www/nostr/monstr_terminal/venv/include/site/python3.8/psycopg2 Check the logs
for
full
command
output.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>
psycopg2 is no longer part of the requirements so isn't installed unless done separately so this probably wouldnt be a problem anymore
Following the install instructions failed on the
pip install -r requirements.txt
step with the following error:I found that pg_config was not in my PATH.
I first tried to install the binary version of psycopg2 as suggested by the error message, using the instructions found here: https://www.psycopg.org/docs/install.html
pip install psychopg2-binary
After this, I tried
pip install -r requirements.txt
and got a little further, but then got a different error message that told me to install:apt install libpq-dev
apt install postgresql-common
I did that. This fixed my PATH so that pg_config returned what looked like a proper response:
Now when I run
pip install -r requirements.txt
I get this:Really not sure how to proceed now.