Psycopg2 ubuntu error command errored out with exit status 1

Ответили на вопрос 1 человек. Оцените лучшие ответы! И подпишитесь на вопрос, чтобы узнавать о появлении новых ответов.

Пакет psycopg2 нужен для установки heroku

В консоли

spoiler

(my-venv) user@user-RC530-RC730:~/Home/ASITES/python/12v$ pip install psycopg2
Collecting psycopg2
  Using cached psycopg2-2.8.5.tar.gz (380 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/user/Home/ASITES/python/12v/my-venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-786b0yov/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-786b0yov/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-786b0yov/psycopg2/pip-egg-info
         cwd: /tmp/pip-install-786b0yov/psycopg2/
    Complete output (23 lines):
    running egg_info
    creating /tmp/pip-install-786b0yov/psycopg2/pip-egg-info/psycopg2.egg-info
    writing /tmp/pip-install-786b0yov/psycopg2/pip-egg-info/psycopg2.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-install-786b0yov/psycopg2/pip-egg-info/psycopg2.egg-info/dependency_links.txt
    writing top-level names to /tmp/pip-install-786b0yov/psycopg2/pip-egg-info/psycopg2.egg-info/top_level.txt
    writing manifest file '/tmp/pip-install-786b0yov/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.
WARNING: You are using pip version 20.0.2; however, version 20.1.1 is available.
You should consider upgrading via the '/home/user/Home/ASITES/python/12v/my-venv/bin/python -m pip install --upgrade pip' command.

Какой командой и как прописать правильно путь?


  • Вопрос задан

    более двух лет назад

  • 315 просмотров

sudo apt-get install python-dev postgresql-server-dev-all

Затем
pip install psycopg2

Пригласить эксперта


  • Показать ещё
    Загружается…

10 февр. 2023, в 02:20

3000 руб./за проект

10 февр. 2023, в 01:33

1500 руб./за проект

10 февр. 2023, в 00:54

2000 руб./в час

Минуточку внимания

Hello all,
With a big of guidance I’m happy to contribute a PR.
For now, let me document the current situation for any other M1 users. Please do correct me if I got the details wrong!

Python 3.8.10 is the first 3.8 version with support for M1 chipset (see bug). Older versions of pyenv do not have access to Python 3.8.10 (some details in here).

pyenv install 3.8.10
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip wheel

If you try to install psycopg2_binary and expect a wheel, it is not currently available.

There’s the SYSTEM_VERSION_COMPAT=1 trick to pretend to be 10.6 instead of 11.x, however, the architecture still returns arm64.

❯ python -c "import platform; print(platform.mac_ver())"
('11.4', ('', '', ''), 'arm64')

~/code/M1 via 🐍 v3.8.2 (venv_3_system) on ☁️  armenzg@sentry.io
❯ SYSTEM_VERSION_COMPAT=1 python -c "import platform; print(platform.mac_ver())"
('10.16', ('', '', ''), 'arm64')

If you don’t have a wheel then you need to build from source. See the log [1] at the bottom of this comment.

In order to have the libraries to build it, I took these steps which are based on this post:

brew install postgresql
# If you open a new terminal tab you will see that pg_config is available
export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include"
export LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib -L${HOME}/.pyenv/versions/3.8.10/lib"

After that, it is possible to build the wheel

pip install psycopg2-binary==2.8.6
Collecting psycopg2-binary==2.8.6
  Using cached psycopg2-binary-2.8.6.tar.gz (384 kB)
Building wheels for collected packages: psycopg2-binary
  Building wheel for psycopg2-binary (setup.py) ... done
  Created wheel for psycopg2-binary: filename=psycopg2_binary-2.8.6-cp38-cp38-macosx_11_0_arm64.whl size=137096 sha256=af1103eb3c4d9fee1636d27e9dbab6c8bbe7fcd8502bea2a4a194f016a8afb85
  Stored in directory: /Users/armenzg/Library/Caches/pip/wheels/15/d7/13/ef37b82cf1de521c82c129a16ad8007a81b4eab0f23b22c7b3
Successfully built psycopg2-binary
Installing collected packages: psycopg2-binary
Successfully installed psycopg2-binary-2.8.6

Did I do this right? How can I help to have a release that includes an arm64 wheel?

[1]

SYSTEM_VERSION_COMPAT=1 pip install psycopg2-binary==2.8.6
Collecting psycopg2-binary==2.8.6
  Using cached psycopg2-binary-2.8.6.tar.gz (384 kB)
    ERROR: Command errored out with exit status 1:
     command: /Users/armenzg/code/M1/venv_3_system/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/j1/d109sd4n55qbk5ty8gzq5jgm0000gn/T/pip-install-9zonoxgp/psycopg2-binary_43fe9c32f13f470ebebbbdf290cabfe4/setup.py'"'"'; __file__='"'"'/private/var/folders/j1/d109sd4n55qbk5ty8gzq5jgm0000gn/T/pip-install-9zonoxgp/psycopg2-binary_43fe9c32f13f470ebebbbdf290cabfe4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/j1/d109sd4n55qbk5ty8gzq5jgm0000gn/T/pip-pip-egg-info-cacpi1hg
         cwd: /private/var/folders/j1/d109sd4n55qbk5ty8gzq5jgm0000gn/T/pip-install-9zonoxgp/psycopg2-binary_43fe9c32f13f470ebebbbdf290cabfe4/
    Complete output (23 lines):
    running egg_info
    creating /private/var/folders/j1/d109sd4n55qbk5ty8gzq5jgm0000gn/T/pip-pip-egg-info-cacpi1hg/psycopg2_binary.egg-info
    writing /private/var/folders/j1/d109sd4n55qbk5ty8gzq5jgm0000gn/T/pip-pip-egg-info-cacpi1hg/psycopg2_binary.egg-info/PKG-INFO
    writing dependency_links to /private/var/folders/j1/d109sd4n55qbk5ty8gzq5jgm0000gn/T/pip-pip-egg-info-cacpi1hg/psycopg2_binary.egg-info/dependency_links.txt
    writing top-level names to /private/var/folders/j1/d109sd4n55qbk5ty8gzq5jgm0000gn/T/pip-pip-egg-info-cacpi1hg/psycopg2_binary.egg-info/top_level.txt
    writing manifest file '/private/var/folders/j1/d109sd4n55qbk5ty8gzq5jgm0000gn/T/pip-pip-egg-info-cacpi1hg/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
    <https://www.psycopg.org/docs/install.html>).

    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/fc/51/0f2c6aec5c59e5640f507b59567f63b9d73a9317898810b4db311da32dfc/psycopg2-binary-2.8.6.tar.gz#sha256=11b9c0ebce097180129e422379b824ae21c8f2a6596b159c7659e2e5a00e1aa0 (from https://pypi.org/simple/psycopg2-binary/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement psycopg2-binary==2.8.6 (from versions: 2.7.4, 2.7.5, 2.7.6, 2.7.6.1, 2.7.7, 2.8, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.8.5, 2.8.6)
ERROR: No matching distribution found for psycopg2-binary==2.8.6

Здравствуйте.
Недавно решил перейти с kali linix на ubuntu, начал ставить ПО и мне понадобилось поставить wifite2, что я и сделал, без проблем установив почти все дополнительные репозитории, но одно я не смог — pyrit.
Пробывал

sudo apt install pyritВывод:

Чтение списков пакетов… Готово
Построение дерева зависимостей       
Чтение информации о состоянии… Готово
E: Невозможно найти пакет pyrit
Далее начал искать информацию в интернете, https://github.com/JPaulMora/Pyrit по этой документации мне нужен был pip для python2,

sudo apt install python2-pipвывел

Чтение списков пакетов… Готово
Построение дерева зависимостей       
Чтение информации о состоянии… Готово
E: Невозможно найти пакет python2-pip
Пытался через easy_install, не помогло, в итоге установил так.
Теперь дело осталось за малым, ввести

sudo pip install psycopg2
sudo pip install scapy
cd Pyrit
python setup.py clean
python setup.py build
Но на первой же команде происходит ошибка:

ERROR: Command errored out with exit status 1:
     command: /usr/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-QpBJzC/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-QpBJzC/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-1LWYPl
         cwd: /tmp/pip-install-QpBJzC/psycopg2/
    Complete output (23 lines):
    running egg_info
    creating /tmp/pip-pip-egg-info-1LWYPl/psycopg2.egg-info
    writing /tmp/pip-pip-egg-info-1LWYPl/psycopg2.egg-info/PKG-INFO
    writing top-level names to /tmp/pip-pip-egg-info-1LWYPl/psycopg2.egg-info/top_level.txt
    writing dependency_links to /tmp/pip-pip-egg-info-1LWYPl/psycopg2.egg-info/dependency_links.txt
    writing manifest file '/tmp/pip-pip-egg-info-1LWYPl/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.

Я понимаю что pyrit необязательная часть но без неё процесс не оканчивается успехом там где с pyrit всё замичательно.
Не судите строго в ubuntu я ещё не разобрался.

The error message ‘error command GCC failed with exit status 1’ mainly occurs while installing Python-related third-party libraries for starting the compilation process. This error message mostly occurs in Linux or macOS systems while working with ‘Terminal. So, Windows users don’t face such problems because all of their work is GUI-based.

error command ‘GCC’ failed with exit status 1 (Main Image)

This is a GCC compiler and required libraries error. However, the above picture doesn’t represent the complete error message as its remaining part contains the specific library or application name in which it occurs.

Error Message: ‘error command ‘GCC’ failed with exit status 1′ (Title Image)

Contents

  • Reasons for the Occurrence of this Error Message
  • To be noted:
  • How to Solve the ‘Error Command GCC Failed with Exit Status 1’ Issue?
    • 1. While Installing ‘Eventlet’
    • 2. For ‘Red Hat Enterprise Linux RPM software package’ Users
    • 3. During Pygame Installation on a macOS system
    • 4. When trying to Build ‘MySQLdb’ on MacOS X Mountain Lion
    • 5. While Installing the ‘python-sane’ Module
    • 6. When Installing ‘psycopg2’

Reasons for the Occurrence of this Error Message

According to the research we have conducted on this error message, these are the most common reasons for it.

  • GCC is a compiler used in Python for compiling programs. This compiler requires some additional development libraries and when the compiler can’t find the required libraries, it gives an error message. This is the most common reason for the occurrence of this error message.
  • If you’ve faced this error message while installing the Python library software and configuring the PIP source, then the ‘OpenSSL-devel’ might be the cause of this error message.
  • Sometimes users face this error message because of applying Windows binaries to a Linux system. This results in an incompatibility between the module and the library you’re trying to install on your machine. So, it’s better to double-check the requirements before searching for any solutions.

To be noted:

The solution to this error message varies from use case to use case because it occurs in several cases. Therefore, before trying any solution, read the use case mentioned in the explanation of every solution. Because this way, it’ll be easier to relate to your use case and solve this error message.

How to Solve the ‘Error Command GCC Failed with Exit Status 1’ Issue?

As mentioned, this error message has different forms. So, read the solutions carefully and apply them only, if you meet their use case. Otherwise, the solution won’t work for you.

1. While Installing ‘Eventlet’

Here, we’ll first mention the use cases, then we’ll move to the actual method to solve the error message under discussion.

Use Cases

Apply this solution, if you meet the following criteria:

  • If you’re facing a ‘Python.h’ fatal directory error while installing ‘Eventlet’ or any other library.
    Occurrence of ‘error command ‘GCC’ failed with exit status 1′ and facing a ‘Python.h’ fatal directory

OR

  • If you’re facing the error message: ‘error command ‘GCC’ failed with exit status 1 CentOS’ while installing the ‘Eventlet’ library on the system to have the ‘Herd’ for software deployment. In this case, the terminal displays the following error message:
    Occurrence of ‘error command ‘GCC’ failed with exit status 1′ during installing ‘Eventlet’

OR

  • If you’re facing this error message while trying to install some library with the pip command. In this case, people got an error like ‘#include <ffi.h>’ and the compilation terminated by the ‘error: command ‘GCC’ failed with exit status 1.

OR

  • If you’re running the command: ‘docker build –tag python-docker-dev and you’ve faced the error message: ‘error command ‘GCC’ failed with exit status 1 docker.

If your situation meets one of the above-mentioned use cases, then try the following solution.

Actual Method

Note: After every command, you’ll hit the ‘Enter’ key to execute the typed commands.

  1. The first step is to ‘update the version of the GCC compiler’ to the latest version because if you skip this, then you might get errors while executing the main commands. So, type the following commands in the ‘Terminal’ window.
Command for Debian, Kali, Mint and UBUNTU:
sudo apt update gcc
Command for CentOS, Fedora and RHEL:
sudo dnf update gcc
Command for MacOS X:
brew install gcc
  1. Now, you’ll install the ‘Build Essentails’ because these are essential for building the source code of libraries and packages. So, type the following commands in the ‘Terminal’ window.
Command for Debian, Kali, Mint and UBUNTU:
sudo apt install build-essential
Command for CentOS, Fedora and RHEL:
sudo dnf install build-essential
  1. After successful installation of ‘Build Essentials,’ you’ll install the ‘Python Development Packages’ by running the following commands in the ‘Terminal’ window.
Command for Debian, Kali, Mint and UBUNTU:
sudo apt install python-dev

sudo apt install python3-dev (for Python 3 users)
Command for CentOS, Fedora and RHEL:
sudo dnf install python-devel

sudo dnf install python3-devel (for Python 3 users)

Note: In the above command, if you’re using an older Python version, just mention that version number after ‘python,like ‘python2.6-dev’

  1. After running all the commands, if you still get an error that’s talking about installing libevent, then you’ll have to install ‘libevent’ with ‘eventlet. So, type the following commands.
Command for Debian, Kali, Mint and UBUNTU:
sudo apt-get install libevent-dev

Note: You can also use ‘sudo apt install libevent-dev’ in the above command.

Command for CentOS, Fedora and RHEL:
sudo dnf install libevent-devel

Hopefully, this solution will prove useful for you because it has solved the same error message for other users as well.

But if you’re still receiving the same error message on ‘Red Hat Enterprise Linux RPM software package, then try the next solution.

2. For ‘Red Hat Enterprise Linux RPM software package’ Users

Here, we’ll first mention the use cases, then we’ll move to the actual method to solve the error message under discussion.

Use Cases

The use cases for this solution are the same as the above solution. So, if you meet the ‘use cases for ‘Solution # 1, then try the following solution.

Actual Method

If you’re a ‘Red Hat Enterprise Linux RPM software package’ user and the commands of solution # 1 didn’t fix the error message ‘error command ‘GCC’ failed with exit status 1’ for you, then try the following commands in your ‘Terminal’ window.

Note: After every command, you’ll hit the ‘Enter’ key to execute the typed command

For Python 2.7 Users:

If you’re using the 2.7 version of Python, then run the following commands.

sudo yum -y install gcc gcc-c++ kernel-devel

Note: If the above command doesn’t work, then try it by excluding ‘kernel’

sudo yum -y install python-devel

Note: If you want to install the ‘Development Packages, then include ‘libxslt-devel libffi-devel OpenSSL-devel’ after the above command. So, your command will be ‘sudo yum -y install python-devel libxslt-devel libffi-devel OpenSSL-devel’

pip install cryptography

Note: In the above command, the ‘cryptography’ is the name of the ‘python package. So, you can replace it with your own python package’s name

For Python 3.4 Users:

If you’re using the 3.4 version of Python, then run the following commands.

sudo apt-get install python3-dev

pip install ‘your python packet’

Note: In the above command, the ‘your python packet’ will be the name of your own Python package.

3. During Pygame Installation on a macOS system

Here, we’ll first mention the use cases, then we’ll move to the actual method to solve the error message under discussion.

Use Cases

Apply this solution, if you meet the following criteria:

  • If you’ve faced the error command ‘GCC’ failed with exit status 1 pygame while installing the ‘Pygame’ on a MacOS system running Catalina and you have reported this error message as: error command ‘GCC’ failed with exit status 1 mac Catalina.’ The error for this case is:
[email protected] ~ % sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.15.2.pkg -target /
installer: Error - the package path specified was invalid: '/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.15.2.pkg'.

If your situation meets the criteria mentioned above, then try the following solution.

Actual Method

If you’ve faced the same error message on a macOS system while installing the Pygame, then use this method because it has helped the other users as well.

>> xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

>> env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install psycopg2==2.8.4
Collecting psycopg2==2.8.4
Using cached psycopg2-2.8.4.tar.gz (377 kB)
Installing collected packages: psycopg2
Attempting uninstall: psycopg2
Found existing installation: psycopg2 2.7.7
Uninstalling psycopg2-2.7.7:
Successfully uninstalled psycopg2-2.7.7
Running setup.py install for psycopg2 ... done
Successfully installed psycopg2-2.8.4

Note: If the above didn’t work, then use ‘install psycopg2-binary

4. When trying to Build ‘MySQLdb’ on MacOS X Mountain Lion

Here, we’ll first mention the use cases, then we’ll move to the actual method to solve the error message under discussion.

Use Cases

Apply this solution, if you meet the following criteria:

  • If you have faced the same error message while trying to build ‘MySQLdb’ on a MacOS system running Mountain Lion. In this case, your error message will look like this:
running build

running build_py

copying MySQLdb/release.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb

running build_ext

building '_mysql' extension

gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -O3 -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/usr/local/mysql/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.6-intel-2.7/_mysql.o -Os -g -fno-common -fno-strict-aliasing -arch x86_64

unable to execute gcc-4.2: No such file or directory

error: command 'gcc-4.2' failed with exit status 1

If your situation meets the criteria mentioned above, then try the following solution.

Actual Method

If you’ve faced the ‘error: command ‘gcc-4.2’ failed with exit status 1’ while trying to build ‘MySQLdb’ on Mac OSX running Mountain Lion, then you can use the following command

sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2

5. While Installing the ‘python-sane’ Module

Here, we’ll first mention the use cases, then we’ll move to the actual method to solve the error message under discussion.

Use Cases

Apply this solution, if you meet the following criteria:

  • If you’ve faced the same error code while trying to install the ‘python-sane’ module. In this case, the users have reported the following error message:

Occurrence of ‘error command ‘GCC’ failed with exit status 1′ while trying to install the ‘python-sane’ module

If your situation meets the criteria mentioned above, then try the following solution.

Actual Method

If you’ve faced this error message while installing the ‘python-sane’ module, then you can add the ‘libsane-dev’ to your group but exclude the ‘libsane-extras’ package.

6. When Installing ‘psycopg2’

Here, we’ll first mention the use cases, then we’ll move to the actual method to solve the error message under discussion.

Use Cases

Apply this solution, if you meet the following criteria.

  • If you’ve faced the above error with psycopg2 in your Mac. In this case, the error message looks like this:
    Occurrence of ‘error command ‘GCC’ failed with exit status 1′ during installing ‘psycopg2’ on MacOS Mojave

If your situation meets the criteria mentioned above, then try the following solution.

Actual Method

If you’re installing ‘psycopg2’ and you’ve received the error message: ‘error: command ‘/usr/bin/clang’ failed with exit status 1, then you can try the following commands in your code.

brew reinstall openssl

export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/

Ezoic

Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to install django-heroku And I am facing following error ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

Contents

  1. How ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output Error Occurs ?
  2. How To Solve ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output Error ?
  3. Solution 1: Use this command
  4. Solution 2: For macOS
  5. Solution 3: Just Install python-dev && libpq-dev
  6. Solution 4: add the package containing the executable pg_config
  7. Summary

I am trying to install django-heroku And I am facing following error.

Error: pg_config executable not found.

pg_config is required to build psycopg2 from source.  Please add t .   he 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 Solve ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output Error ?

  1. How To Solve ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output Error ?

    To Solve ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output Error This command worked for me on Ubuntu. sudo apt-get install libpq-dev. If you are using macOS then simply run this command And your error will be solve. brew install postgresql. You just need to install libpq-dev and python-dev using following command. Or Just need to add the package containing the executable pg_config. And pg_config is in postgresql-devel.

  2. ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output

    To Solve ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output Error This command worked for me on Ubuntu. sudo apt-get install libpq-dev. If you are using macOS then simply run this command And your error will be solve. brew install postgresql. You just need to install libpq-dev and python-dev using following command. Or Just need to add the package containing the executable pg_config. And pg_config is in postgresql-devel.

Solution 1: Use this command

This command worked for me on Ubuntu.

sudo apt-get install libpq-dev

Solution 2: For macOS

If you are using macOS then simply run this command And your error will be solve.

brew install postgresql

Solution 3: Just Install python-dev && libpq-dev

You just need to install libpq-dev and python-dev using following command.

sudo apt-get install libpq-dev python-dev

Solution 4: add the package containing the executable pg_config

Just need to add the package containing the executable pg_config. And pg_config is in postgresql-devel.

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

  • AttributeError: module ‘time’ has no attribute ‘clock’

Понравилась статья? Поделить с друзьями:
  • Ps4 ошибка nw 31291 6
  • Psycopg2 operationalerror ssl syscall error eof detected
  • Ps4 ошибка ce 35290 9
  • Psycopg2 errors syntaxerror syntax error at or near where
  • Ps4 ошибка ce 34878 0 что это