Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

272
Vistas
When run `pip-compile requirements.in` in macOS12 monterey using venv python-3.9.9, pg_config not found

OS: monterey macOSv12.0.1 python venv: 3.9.9

requirements.in

# To update requirements.txt, run:
#
#    pip-compile requirements.in
#
# To install in localhost, run:
#
#    pip-sync requirements.txt
#

django==3.2.10  # https://www.djangoproject.com/

psycopg2-binary==2.9.2 # https://github.com/psycopg/psycopg2

After i turn on venv, then i type pip-compile requirements.in then i get a bunch of errors about pg_config not found

This is my asciinema https://asciinema.org/a/sl9MqmrayLAR3rRxEul4mYaxw

I have tried env LDFLAGS='-L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib' pip-compile requirements.in but same.

Please advise.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

I appreciate the other 2 answers from @Vishnudev and @cetver 🙏

But I tried to install postgresql using brew install and it took a very long time and I still cannot complete after 20 mins.

I figured this out eventually after much googling

Here are my tech specs of my situation:

  1. monterey 12.1.0
  2. Apple silicon
  3. zsh

Concepts

Conceptually, what I did is :

  1. install openssl, turn on all the exports associated with that,
  2. then install libpq, turn on all the exports associated with that,
  3. then turn on python venv

Here are my steps I took. It's entirely possible not all steps are needed. But I have limited time so here they are.

Steps

  1. brew install openssl
  2. put the following in .zshrc export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH"
  3. put the following in .zshenv
export LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@1.1/lib/pkgconfig"
  1. source ~/.zshrc
  2. brew install libpq
  3. put the following in .zshrc export PATH="/opt/homebrew/opt/libpq/bin:$PATH"
  4. put the following in .zshenv
export LDFLAGS="-L/opt/homebrew/opt/libpq/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libpq/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/libpq/lib/pkgconfig"
  1. source ~/.zshenv
  2. Turn on venv
  3. Now the installing of psycopg2-binary should work

Links that help me:

  1. the one abt openssl
  2. the one abt libpq
over 4 years ago · Santiago Trujillo Denunciar

0

You'll need to install openssl using brew

brew install openssl
brew install postgres       # If not installed and if required

Set the environment variables globally either temporarily by copying the below into the terminal or adding to .bashrc

export LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include"

You'll also need to set the path for PostgreSQL if not set

export PATH=/opt/homebrew/opt/postgresql@11/bin:$PATH

REMEMBER: Replace @___ with your version

Then proceed with requirements.txt

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda