This repository was archived by the owner on Oct 7, 2022. It is now read-only.
This repository was archived by the owner on Oct 7, 2022. It is now read-only.
Generated requirements.nix leads to failing psycopg2 shell. #296
Closed
Description
(Assumption in the title, proceed with caution)
Generating an expression from a requirements.txt that includes psycopg2 (amongst other things) with the following command:
pypi2nix -v -V 3.6 -r requirements.txt -E postgresql -E pkgconfig -E zlib -E libjpeg -E openjpeg -E libtiff -E freetype -E lcms2 -E libwebp -E tcl
Correctly builds and generates a nix file. However, after trying to use said fail with either nix-shell
, nix-build
, or nix
commands leads to a build error:
[...]
building
installing
/build/olefile-0.46/dist /build/olefile-0.46
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/compat.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-3.6/psycopg2
copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2
running build_ext
Error: pg_config executable not found.
pg_config is required to build psycopg2 from source. Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.
For further information please check the 'doc/src/install.rst' file (also at
<http://initd.org/psycopg/docs/install.html>).
[...]
System information:
- system: `"x86_64-linux"`
- host os: `Linux 4.19.66, NixOS, 19.09pre189585.1412af4b2cf (Loris)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.2.2`
- channels(root): `"nixos-19.09pre189585.1412af4b2cf"`
- channels(blanc): `"home-manager, nixos-19.09pre189585.1412af4b2cf, nixpkgs-19.09pre190003.ed07403382c"`
- nixpkgs: `/home/blanc/.nix-defexpr/channels/nixpkgs`