Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Cant install latest version with pip #330

Closed
spirillen opened this issue Feb 7, 2023 · 2 comments
Closed

BUG: Cant install latest version with pip #330

spirillen opened this issue Feb 7, 2023 · 2 comments
Assignees
Labels

Comments

@spirillen
Copy link
Contributor

Description

python3.10 -m pip install -U --pre pyfunceble-dev

or

python3.10 -m pip install -U -I --pre pyfunceble-dev
Building wheels for collected packages: psycopg2
Building wheel for psycopg2 (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [40 lines of output]
/home/spirillen/.local/lib/python3.10/site-packages/setuptools/config/setupcfg.py:520: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
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/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-cpython-310/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-cpython-310
creating build/temp.linux-x86_64-cpython-310/psycopg
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 "-DPSYCOPG_VERSION=2.9.5 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=140006 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -I/usr/include/libxml2 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-cpython-310/psycopg/adapter_asis.o -Wdeclaration-after-statement
In file included from psycopg/adapter_asis.c:28:
./psycopg/psycopg.h:36:10: fatal error: libpq-fe.h: No such file or directory
36 | #include <libpq-fe.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
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for psycopg2
Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: msgpack, charset-normalizer, urllib3, toml, shtab, setuptools, ruamel.yaml.clib, PyYAML, python-dotenv, python-box, PySocks, PyMySQL, pycparser, psycopg2, packaging, MarkupSafe, inflection, idna, greenlet,dnspython, colorama, certifi, SQLAlchemy, ruamel.yaml, requests, Mako, domain2idna, cffi, requests-toolbelt, cryptography, alembic, pyfunceble-dev
Running setup.py install for psycopg2 ... error
error: subprocess-exited-with-error

× Running setup.py install for psycopg2 did not run successfully.
│ exit code: 1
╰─> [42 lines of output]
/home/spirillen/.local/lib/python3.10/site-packages/setuptools/config/setupcfg.py:520: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
running install
/home/spirillen/.local/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/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-cpython-310/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-cpython-310
creating build/temp.linux-x86_64-cpython-310/psycopg
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 "-DPSYCOPG_VERSION=2.9.5 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=140006 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -I/usr/include/libxml2 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-cpython-310/psycopg/adapter_asis.o -Wdeclaration-after-statement
In file included from psycopg/adapter_asis.c:28:
./psycopg/psycopg.h:36:10: fatal error: libpq-fe.h: No such file or directory
36 | #include <libpq-fe.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
[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.
╰─> psycopg2

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
spirillen@lapdancer:~/Downloads/git_projects/mypdns/adblocker-rules$ python3.10 -m pip install -U --pre pyfunceble-dev
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pyfunceble-dev in /home/spirillen/.local/lib/python3.10/site-packages (4.2.0a2)
Collecting pyfunceble-dev
Using cached PyFunceble_dev-4.2.0a7-py3-none-any.whl (497 kB)
Requirement already satisfied: requests[socks]<3 in /home/spirillen/.local/lib/python3.10/site-packages (from pyfunceble-dev) (2.28.1)
Requirement already satisfied: python-dotenv in /home/spirillen/.local/lib/python3.10/site-packages (from pyfunceble-dev) (0.21.1)
Requirement already satisfied: PyMySQL in /home/spirillen/.local/lib/python3.10/site-packages (from pyfunceble-dev) (1.0.2)
Requirement already satisfied: cryptography>=3.3.2 in /home/spirillen/.local/lib/python3.10/site-packages (from pyfunceble-dev) (38.0.4)
Requirement already satisfied: PyYAML in /home/spirillen/.local/lib/python3.10/site-packages (from pyfunceble-dev) (6.0)
Requirement already satisfied: SQLAlchemy~=1.4 in /home/spirillen/.local/lib/python3.10/site-packages (from pyfunceble-dev) (1.4.41)
Requirement already satisfied: domain2idna>=1.12.0 in /home/spirillen/.local/lib/python3.10/site-packages (from pyfunceble-dev) (1.12.0)
Requirement already satisfied: setuptools in /home/spirillen/.local/lib/python3.10/site-packages (from pyfunceble-dev) (67.2.0)
Requirement already satisfied: python-box[all]~=6.0.0 in /home/spirillen/.local/lib/python3.10/site-packages (from pyfunceble-dev) (6.0.2)
Requirement already satisfied: inflection in /home/spirillen/.local/lib/python3.10/site-packages (from pyfunceble-dev) (0.5.1)
Requirement already satisfied: shtab in /home/spirillen/.local/lib/python3.10/site-packages (from pyfunceble-dev) (1.5.8)
Requirement already satisfied: alembic in /home/spirillen/.local/lib/python3.10/site-packages (from pyfunceble-dev) (1.9.0)
Requirement already satisfied: colorama in /home/spirillen/.local/lib/python3.10/site-packages (from pyfunceble-dev) (0.4.6)
Collecting dnspython[doh]~=2.0.0
Using cached dnspython-2.0.0-py3-none-any.whl (208 kB)
Requirement already satisfied: packaging in /home/spirillen/.local/lib/python3.10/site-packages (from pyfunceble-dev) (22.0)
Collecting psycopg2
Using cached psycopg2-2.9.5.tar.gz (384 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: cffi>=1.12 in /home/spirillen/.local/lib/python3.10/site-packages (from cryptography>=3.3.2->pyfunceble-dev) (1.15.1)
Requirement already satisfied: requests-toolbelt in /home/spirillen/.local/lib/python3.10/site-packages (from dnspython[doh]~=2.0.0->pyfunceble-dev) (0.10.1)
Requirement already satisfied: toml in /home/spirillen/.local/lib/python3.10/site-packages (from python-box[all]~=6.0.0->pyfunceble-dev) (0.10.2)
Requirement already satisfied: ruamel.yaml>=0.17 in /home/spirillen/.local/lib/python3.10/site-packages (from python-box[all]~=6.0.0->pyfunceble-dev) (0.17.21)
Requirement already satisfied: msgpack in /home/spirillen/.local/lib/python3.10/site-packages (from python-box[all]~=6.0.0->pyfunceble-dev) (1.0.5rc1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/spirillen/.local/lib/python3.10/site-packages (from requests[socks]<3->pyfunceble-dev) (1.26.14)
Collecting charset-normalizer<3,>=2
Using cached charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Requirement already satisfied: idna<4,>=2.5 in /home/spirillen/.local/lib/python3.10/site-packages (from requests[socks]<3->pyfunceble-dev) (3.4)
Requirement already satisfied: certifi>=2017.4.17 in /home/spirillen/.local/lib/python3.10/site-packages (from requests[socks]<3->pyfunceble-dev) (2022.12.7)
Requirement already satisfied: PySocks!=1.5.7,>=1.5.6 in /home/spirillen/.local/lib/python3.10/site-packages (from requests[socks]<3->pyfunceble-dev) (1.7.1)
Requirement already satisfied: greenlet!=0.4.17 in /home/spirillen/.local/lib/python3.10/site-packages (from SQLAlchemy~=1.4->pyfunceble-dev) (1.1.3)
Requirement already satisfied: Mako in /home/spirillen/.local/lib/python3.10/site-packages (from alembic->pyfunceble-dev) (1.2.4)
Requirement already satisfied: pycparser in /home/spirillen/.local/lib/python3.10/site-packages (from cffi>=1.12->cryptography>=3.3.2->pyfunceble-dev) (2.21)
Requirement already satisfied: ruamel.yaml.clib>=0.2.6 in /home/spirillen/.local/lib/python3.10/site-packages (from ruamel.yaml>=0.17->python-box[all]~=6.0.0->pyfunceble-dev) (0.2.7)
Requirement already satisfied: MarkupSafe>=0.9.2 in /home/spirillen/.local/lib/python3.10/site-packages (from Mako->alembic->pyfunceble-dev) (2.1.1)
Building wheels for collected packages: psycopg2
Building wheel for psycopg2 (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [40 lines of output]
/home/spirillen/.local/lib/python3.10/site-packages/setuptools/config/setupcfg.py:520: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
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/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-cpython-310/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-cpython-310
creating build/temp.linux-x86_64-cpython-310/psycopg
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 "-DPSYCOPG_VERSION=2.9.5 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=140006 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -I/usr/include/libxml2 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-cpython-310/psycopg/adapter_asis.o -Wdeclaration-after-statement
In file included from psycopg/adapter_asis.c:28:
./psycopg/psycopg.h:36:10: fatal error: libpq-fe.h: No such file or directory
36 | #include <libpq-fe.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
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for psycopg2
Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: psycopg2, dnspython, charset-normalizer, pyfunceble-dev
Running setup.py install for psycopg2 ... error
error: subprocess-exited-with-error

× Running setup.py install for psycopg2 did not run successfully.
│ exit code: 1
╰─> [42 lines of output]
/home/spirillen/.local/lib/python3.10/site-packages/setuptools/config/setupcfg.py:520: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
running install
/home/spirillen/.local/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/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-cpython-310/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-cpython-310/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-cpython-310
creating build/temp.linux-x86_64-cpython-310/psycopg
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 "-DPSYCOPG_VERSION=2.9.5 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=140006 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -I/usr/include/libxml2 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-cpython-310/psycopg/adapter_asis.o -Wdeclaration-after-statement
In file included from psycopg/adapter_asis.c:28:
./psycopg/psycopg.h:36:10: fatal error: libpq-fe.h: No such file or directory
36 | #include <libpq-fe.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
[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.
╰─> psycopg2

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

Configuration

Reproduction

Expected behavior

Screenshots

Versions

OS:

Python Version:

PyFunceble Version:

Additional context

@funilrys
Copy link
Owner

funilrys commented Apr 29, 2023

This should be solved by installing python3-dev.

apt install python3-dev

or under Arch:

pacman -S cmake gcc python3

TODOs:

  • Make PSQL an optional dependency.

funilrys added a commit that referenced this issue Apr 29, 2023
This patch fixes #330.

Contributors:
  * @spirillen
@spirillen
Copy link
Contributor Author

4.2.0a8.dev installed smoothly, seems like upgrading the sqlalchemy solved the dependency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants