Issue
I am trying to setup saleor (Django based). I did a "python -m pip install -r requirements.txt" as stated on the website. Things go well until the installation Collecting psycopg2-binary==2.8.3 and then error is thrown. I have Postgre installed and I am on windows. I also have added the path to pg_config on my environment variable since it says pg_config executable not found. I am not sure how to proceed.
Here is the error that is shows up:
ERROR: Command errored out with exit status 1:
command: 'C:\Users\ASPIRE\AppData\Local\Programs\Python\Python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ASPIRE\\AppData\\Local\\Temp\\pip-install-d7c359c_\\psycopg2-binary\\setup.py'"'"'; __file__='"'"'C:\\Users\\ASPIRE\\AppData\\Local\\Temp\\pip-install-d7c359c_\\psycopg2-binary\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\ASPIRE\AppData\Local\Temp\pip-install-d7c359c_\psycopg2-binary\pip-egg-info'
cwd: C:\Users\ASPIRE\AppData\Local\Temp\pip-install-d7c359c_\psycopg2-binary\
Complete output (23 lines):
running egg_info
creating C:\Users\ASPIRE\AppData\Local\Temp\pip-install-d7c359c_\psycopg2-binary\pip-egg-info\psycopg2_binary.egg-info
writing C:\Users\ASPIRE\AppData\Local\Temp\pip-install-d7c359c_\psycopg2-binary\pip-egg-info\psycopg2_binary.egg-info\PKG-INFO
writing dependency_links to C:\Users\ASPIRE\AppData\Local\Temp\pip-install-d7c359c_\psycopg2-binary\pip-egg-info\psycopg2_binary.egg-info\dependency_links.txt
writing top-level names to C:\Users\ASPIRE\AppData\Local\Temp\pip-install-d7c359c_\psycopg2-binary\pip-egg-info\psycopg2_binary.egg-info\top_level.txt
writing manifest file 'C:\Users\ASPIRE\AppData\Local\Temp\pip-install-d7c359c_\psycopg2-binary\pip-egg-info\psycopg2_binary.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
<http://initd.org/psycopg/docs/install.html>).
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Any help is appreciated. Thanks
Solution
The problem was that the environment variable PATH
was not set properly. It is used to find executables that are not in the current directory.
For your purposes you don't have to change the PATH
permanently:
Open the command line (DOS box) with
cmd.exe
.Look at the current settings with
PATH
.Change the value for the current session with
SET PATH="C:\Program Files\PostgreSQL\12\bin";%PATH%
Now it should work.
There is a way to set environment variables permanently on Windows, but they hide it better from version to version. A web search will usually help.
Answered By - Laurenz Albe
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.