Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: pg_config executable not found. when Downloading psycopg2-binary-2.8.4.tar.gz on docker compose #43

Open
jugpoi1 opened this issue May 5, 2023 · 2 comments

Comments

@jugpoi1
Copy link

jugpoi1 commented May 5, 2023

Expected Behavior

Go to the next step docker-compose up -d postgres redis webserver celery_worker

Actual Behavior

docker compose was unsuccessful due to Error: pg_config executable not found.

Despite psycopg2 was installed and version 2.9.6.

Steps to Reproduce the Problem

following Docker installation, reach and type below command
$docker-compose build

Build will cease when it reaches Downloading psycopg2-binary-2.8.4.tar.gz. There will be an error as shown below

Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'error'

error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [35 lines of output]
running egg_info
writing psycopg2_binary.egg-info/PKG-INFO
writing dependency_links to psycopg2_binary.egg-info/dependency_links.txt
writing top-level names to psycopg2_binary.egg-info/top_level.txt
/tmp/pip-build-env-5dzbzw8b/overlay/lib/python3.8/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in setup.cfg
!!

          ********************************************************************************
          The license_file parameter is deprecated, use license_files instead.
  
          By 2023-Oct-30, you need to update your project and remove deprecated calls
          or your builds will no longer be supported.
  
          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
          ********************************************************************************
  
  !!
    parsed = self.parsers.get(option_name, lambda x: x)(value)
  
  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>).
  
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR:

Specifications

  • OpenCVE version: pulled from Docker, 1.4.0
  • Platform: ubuntu 20.04.2 ARM64
  • Docker version: 23.0.5
  • Docker-compose version: 1.25.0

Screenshots (optional)

@matiferrigno
Copy link

matiferrigno commented May 25, 2023

I'm not sure but it seems like platform issue (arm64).

But, watching this #38 ... did you try building with --no-cache and pulling the latest base image?

@ragaskar
Copy link

FWIW, I had this problem and can confirm that I experience the error on my M1 mac.

When I

DOCKER_DEFAULT_PLATFORM=linux/amd64 docker compose build

As suggested by this comment on 37, everything works fine.

Might be nice to drop this in the docker docs to prevent additional issues being opened? (Us apple silicon users are pretty used to docker arch fails and I begin to expect them as the cause whenever I have a problem, but always nice to have it called out)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants