Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

270
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!