bulky-evening-62934
04/22/2020, 6:15 PMpsycopg
as a third party dependency, the error is,
Error: pg_config executable not found.
I actually have pg_config
in the $PATH, which pg_config
--> /usr/local/bin/pg_config
,
I’m wondering the issue is that pex subprosses don’t have it in its $PATH, am I missing some settings ?
(one solution is using psycopg-binary, which is the pre built wheel, but the authors said not using it in production …)hundreds-father-404
04/22/2020, 6:18 PMbulky-evening-62934
04/22/2020, 6:18 PM./pants binary
bulky-evening-62934
04/22/2020, 6:19 PMpsycopg
is a third party dependency specified in BUILDhundreds-father-404
04/22/2020, 6:21 PM$PATH
by default in the subprocess. Precisely, we include whatever you specify in --python-setup-interpreter-search-paths
. Maybe you removed <PATH>
from it, given the prior thread?bulky-evening-62934
04/22/2020, 6:26 PMERROR: process 'Resolving psycopg2==2.8.5' failed with exit code 1.
stdout:
stderr:
ERROR: Command errored out with exit status 1:
command: /Users/yuhan/.pyenv/versions/3.7.5/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-download-voh40dac/psycopg2/setup.py'"'"'; __file__='"'"'/private/tmp/pip-download-voh40dac/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' --no-user-cfg egg_info --egg-base /private/tmp/pip-download-voh40dac/psycopg2/pip-egg-info
cwd: /private/tmp/pip-download-voh40dac/psycopg2/
Complete output (23 lines):
running egg_info
creating /private/tmp/pip-download-voh40dac/psycopg2/pip-egg-info/psycopg2.egg-info
writing /private/tmp/pip-download-voh40dac/psycopg2/pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to /private/tmp/pip-download-voh40dac/psycopg2/pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing top-level names to /private/tmp/pip-download-voh40dac/psycopg2/pip-egg-info/psycopg2.egg-info/top_level.txt
writing manifest file '/private/tmp/pip-download-voh40dac/psycopg2/pip-egg-info/psycopg2.egg-info/SOURCES.txt'
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
<<https://www.psycopg.org/docs/install.html>>).
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
pid: 3636 -> /Users/yuhan/.pyenv/versions/3.7.5/bin/python3.7 /private/var/folders/97/q6plwtfn2mqcqm_3ywcv8nhh0000gp/T/process-executiongCXkjm/pex_root/pip.pex/49a647f5ed9e81dc8f85560600c53fbb4dfc60f0 --disable-pip-version-check --isolated --no-python-version-warning -q --cache-dir /private/var/folders/97/q6plwtfn2mqcqm_3ywcv8nhh0000gp/T/process-executiongCXkjm/pex_root download --dest /tmp/tmp6x5l9hw9/resolved_dists/cp37-cp37m --index-url <https://pypi.org/simple/> psycopg2==2.8.5 raised Executing /Users/yuhan/.pyenv/versions/3.7.5/bin/python3.7 /private/var/folders/97/q6plwtfn2mqcqm_3ywcv8nhh0000gp/T/process-executiongCXkjm/pex_root/pip.pex/49a647f5ed9e81dc8f85560600c53fbb4dfc60f0 --disable-pip-version-check --isolated --no-python-version-warning -q --cache-dir /private/var/folders/97/q6plwtfn2mqcqm_3ywcv8nhh0000gp/T/process-executiongCXkjm/pex_root download --dest /tmp/tmp6x5l9hw9/resolved_dists/cp37-cp37m --index-url <https://pypi.org/simple/> psycopg2==2.8.5 failed with 1
bulky-evening-62934
04/22/2020, 6:28 PM_PATH_=create_path_env_var(python_setup.interpreter_search_paths)
, env
is default to Nonebulky-evening-62934
04/22/2020, 6:29 PMhundreds-father-404
04/22/2020, 6:33 PMenv
is none, but new_entries
is specified to be whatever python_setup.interpreter_search_paths
is. So long as --python-setup-interpreter-search-paths
includes <PATH>
, that will get passed to the Pex subprocessbulky-evening-62934
04/22/2020, 6:35 PMinterpreter_search_paths = ["<PYENV>"]
, so I need to write something like ``interpreter_search_paths = ["<PYENV>", "$PATH"]`` ? (if my PR get passed ; ) )hundreds-father-404
04/22/2020, 6:35 PMhundreds-father-404
04/22/2020, 6:36 PM<PATH>
, that is a special valuebulky-evening-62934
04/22/2020, 6:42 PMinterpreter_search_paths = ["<PYENV>", "<PATH>"]
works perfectly,hundreds-father-404
04/22/2020, 6:42 PM