Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

275
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda