As i run pip install psycopg2 in my django virtualven in windows it start downloading and at the end of downloading this Error comes
|████████████████████████████████| 430kB 61kB/s
ERROR: Command errored out with exit status 1:
command: 'c:\users\tusha\appdata\local\programs\python\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\tusha\\AppData\\Local\\Temp\\pip-install-hoeubopv\\psycopg2\\setup.py'"'"'; __file__='"'"'C:\\Users\\tusha\\AppData\\Local\\Temp\\pip-install-hoeubopv\\psycopg2\\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\tusha\AppData\Local\Temp\pip-install-hoeubopv\psycopg2\pip-egg-info'
cwd: C:\Users\tusha\AppData\Local\Temp\pip-install-hoeubopv\psycopg2\
Complete output (23 lines):
running egg_info
creating C:\Users\tusha\AppData\Local\Temp\pip-install-hoeubopv\psycopg2\pip-egg-info\psycopg2.egg-info
writing C:\Users\tusha\AppData\Local\Temp\pip-install-hoeubopv\psycopg2\pip-egg-info\psycopg2.egg-info\PKG-INFO
writing dependency_links to C:\Users\tusha\AppData\Local\Temp\pip-install-hoeubopv\psycopg2\pip-egg-info\psycopg2.egg-info\dependency_links.txt
writing top-level names to C:\Users\tusha\AppData\Local\Temp\pip-install-hoeubopv\psycopg2\pip-egg-info\psycopg2.egg-info\top_level.txt
writing manifest file 'C:\Users\tusha\AppData\Local\Temp\pip-install-hoeubopv\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 PyPIe install the PyPI
'psycopg2-binary' package instead.
st' file (also at
For further information please check the 'doc/src/install.rst' file (also at
<http://initd.org/psycopg/docs/install.html>).
egg_info Check the logs for full command outpu
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py
egg_info Check the logs for full command output.
so how to solve this ERROR
Try this:
pip install psycopg2-binary
Related
I am firing following command and it's showing the same for psycopg2-binary
(demo) C:\Users\Lenovo\Desktop\Django>pip install psycopg2
Collecting psycopg2
Using cached psycopg2-2.8.6.tar.gz (383 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\lenovo\desktop\django\demo\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Lenovo\\AppData\\Local\\Temp\\pip-install-pq1_j08j\\psycopg2\\setup.py'"'"'; __file__='"'"'C:\\Users\\Lenovo\\AppData\\Local\\Temp\\pip-install-pq1_j08j\\psycopg2\\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\Lenovo\AppData\Local\Temp\pip-pip-egg-info-a33qt0v5'
cwd: C:\Users\Lenovo\AppData\Local\Temp\pip-install-pq1_j08j\psycopg2\
Complete output (23 lines):
running egg_info
creating C:\Users\Lenovo\AppData\Local\Temp\pip-pip-egg-info-a33qt0v5\psycopg2.egg-info
writing C:\Users\Lenovo\AppData\Local\Temp\pip-pip-egg-info-a33qt0v5\psycopg2.egg-info\PKG-INFO
writing dependency_links to C:\Users\Lenovo\AppData\Local\Temp\pip-pip-egg-info-a33qt0v5\psycopg2.egg-info\dependency_links.txt
writing top-level names to C:\Users\Lenovo\AppData\Local\Temp\pip-pip-egg-info-a33qt0v5\psycopg2.egg-info\top_level.txt
writing manifest file 'C:\Users\Lenovo\AppData\Local\Temp\pip-pip-egg-info-a33qt0v5\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.
Maybe this will help(pip install psycopg2). As I understand, there is kind of answer (pg_config executable not found).Maybe I'm wrong (99% guarantee, that I'm wrong, just because I'm new one in programming).
I am using conda package and while trying to install psycopg2 i got this error.
I want this for postgis and i am running on ubuntu.
ERROR: Command errored out with exit status 1:
command: /home/srijan/anaconda3/envs/django/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-s5yimrpg/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-s5yimrpg/psycopg2/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 /tmp/pip-pip-egg-info-cop18avg
cwd: /tmp/pip-install-s5yimrpg/psycopg2/
Complete output (14 lines):
running egg_info
creating /tmp/pip-pip-egg-info-cop18avg/psycopg2.egg-info
writing /tmp/pip-pip-egg-info-cop18avg/psycopg2.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-cop18avg/psycopg2.egg-info/dependency_links.txt
writing top-level names to /tmp/pip-pip-egg-info-cop18avg/psycopg2.egg-info/top_level.txt
writing manifest file '/tmp/pip-pip-egg-info-cop18avg/psycopg2.egg-info/SOURCES.txt'
Error: pg_config executable not found.
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'.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Installing python-dev(it might be python3-dev, install according to your current python version) and libpq-dev should solve your problem.
Also Check out this stackoverflow question pg_config executable not found. It talks about the same problem.
I am trying to deploy my django application to heroku.
When I try to pip install django-heroku, it gives me this error:
ERROR: Command errored out with exit status 1:
command: /Users/huntermackenzie/Dev/personal/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/15/k9lcjv5129v661mkkrsdt09w0000gn/T/pip-install-v2fvrgwp/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/15/k9lcjv5129v661mkkrsdt09w0000gn/T/pip-install-v2fvrgwp/psycopg2/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 /private/var/folders/15/k9lcjv5129v661mkkrsdt09w0000gn/T/pip-install-v2fvrgwp/psycopg2/pip-egg-info
cwd: /private/var/folders/15/k9lcjv5129v661mkkrsdt09w0000gn/T/pip-install-v2fvrgwp/psycopg2/
Complete output (23 lines):
running egg_info
creating /private/var/folders/15/k9lcjv5129v661mkkrsdt09w0000gn/T/pip-install-v2fvrgwp/psycopg2/pip-egg-info/psycopg2.egg-info
writing /private/var/folders/15/k9lcjv5129v661mkkrsdt09w0000gn/T/pip-install-v2fvrgwp/psycopg2/pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to /private/var/folders/15/k9lcjv5129v661mkkrsdt09w0000gn/T/pip-install-v2fvrgwp/psycopg2/pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing top-level names to /private/var/folders/15/k9lcjv5129v661mkkrsdt09w0000gn/T/pip-install-v2fvrgwp/psycopg2/pip-egg-info/psycopg2.egg-info/top_level.txt
writing manifest file '/private/var/folders/15/k9lcjv5129v661mkkrsdt09w0000gn/T/pip-install-v2fvrgwp/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.
Trying to pip install psycopg2 gives me the same error.
Can someone please help me. Thank you.
The error message suggests
pip install psycopg2-binary
have you tried it?
I am using source code https://github.com/odoo/odoo/tree/aa0554d224337e1d966479a351a3ed059d297765
on Windows 10, Python version
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC v.1916 32 bit (Intel)] on win32
I catch error
ERROR: Command errored out with exit status 1:
command: 'c:\program files (x86)\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\xxxxxxxx\\AppData\\Local\\Temp\\pip-install-e5g8ghcb\\psycopg2\\setup.py'"'"'; __file__='"'"'C:\\Users\\xxxxxxxx\\AppData\\Local\\Temp\\pip-install-e5g8ghcb\\psycopg2\\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\xxxxxxxx\AppData\Local\Temp\pip-install-e5g8ghcb\psycopg2\pip-egg-info'
cwd: C:\Users\xxxxxxxx\AppData\Local\Temp\pip-install-e5g8ghcb\psycopg2\
Complete output (23 lines):
running egg_info
creating C:\Users\xxxxxxxx\AppData\Local\Temp\pip-install-e5g8ghcb\psycopg2\pip-egg-info\psycopg2.egg-info
writing C:\Users\xxxxxxxx\AppData\Local\Temp\pip-install-e5g8ghcb\psycopg2\pip-egg-info\psycopg2.egg-info\PKG-INFO
writing dependency_links to C:\Users\xxxxxxxx\AppData\Local\Temp\pip-install-e5g8ghcb\psycopg2\pip-egg-info\psycopg2.egg-info\dependency_links.txt
writing top-level names to C:\Users\xxxxxxxx\AppData\Local\Temp\pip-install-e5g8ghcb\psycopg2\pip-egg-info\psycopg2.egg-info\top_level.txt
writing manifest file 'C:\Users\xxxxxxxx\AppData\Local\Temp\pip-install-e5g8ghcb\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
<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.
How to fix it?
From Windows Source Install
Warning
Some dependencies cannot be installed through pip and require to be installed manually.
In particular:psycopg must be installed with
this installer.wkhtmltopdf must be installed in version 0.12.5
for it to support headers and footers. See our
wiki for more details on the
various versions.
As the error message suggest to you:
If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.
The psycopg2 package for Python 3.8 is released and you can
install it with pip:
pip install psycopg2
If you want to install psycopg2 from source, refer to the official
docs.
i am installing connector of Psycopg2 but i am unable install, how do i install that successfully?
in using this command line to install:
pip install psycopg2
(test) C:\Users\Shree.Shree-PC\Desktop\projects\purchasepo>pip install psycopg2
Collecting psycopg2
Using cached https://files.pythonhosted.org/packages/84/d7/6a93c99b5ba4d4d22daa3928b983cec66df4536ca50b22ce5dcac65e4e71/psycopg2-2.8.4.tar
.gz
ERROR: Command errored out with exit status 1:
command: 'c:\users\shree.shree-pc\envs\test\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Shr
ee.Shree-PC\\AppData\\Local\\Temp\\pip-install-_bgz1zs9\\psycopg2\\setup.py'"'"'; __file__='"'"'C:\\Users\\Shree.Shree-PC\\AppData\\Local\\T
emp\\pip-install-_bgz1zs9\\psycopg2\\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\Shree.Shree-PC\AppData\Local\Temp\pip-
install-_bgz1zs9\psycopg2\pip-egg-info'
cwd: C:\Users\Shree.Shree-PC\AppData\Local\Temp\pip-install-_bgz1zs9\psycopg2\
Complete output (23 lines):
running egg_info
creating C:\Users\Shree.Shree-PC\AppData\Local\Temp\pip-install-_bgz1zs9\psycopg2\pip-egg-info\psycopg2.egg-info
writing C:\Users\Shree.Shree-PC\AppData\Local\Temp\pip-install-_bgz1zs9\psycopg2\pip-egg-info\psycopg2.egg-info\PKG-INFO
writing dependency_links to C:\Users\Shree.Shree-PC\AppData\Local\Temp\pip-install-_bgz1zs9\psycopg2\pip-egg-info\psycopg2.egg-info\depe
ndency_links.txt
writing top-level names to C:\Users\Shree.Shree-PC\AppData\Local\Temp\pip-install-_bgz1zs9\psycopg2\pip-egg-info\psycopg2.egg-info\top_l
evel.txt
writing manifest file 'C:\Users\Shree.Shree-PC\AppData\Local\Temp\pip-install-_bgz1zs9\psycopg2\pip-egg-info\psycopg2.egg-info\SOURCES.t
xt'
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.
command line is correct
path should be checked and perhaps psycopg2 needs a visual C ++ build tools update from https://visualstudio.microsoft.com/visual-cpp-build-tools/
I had this problem when I installed python 3.10.0
if you are using python 3.10:
currently psycopg doesn't support python 3.10
The current psycopg2 implementation supports:
1.Python versions from 3.6 to 3.9
2.PostgreSQL server versions from 7.4 to 13
3.PostgreSQL client library version from 9.1
source : https://www.psycopg.org/docs/install.html
and if you're using windows with any version of python but 3.10 please try install psycopg2 by running :
pip install psycopg2-binary