# pip install psycopg2
Error: pg_config executable not found.
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'.
To fix the above error while trying to install psycopg2 on your Mac/Linux/Debian device, you can try the below,
Ubuntu:# sudo apt-get install libpq-dev
macOS:
%
Alpine Linux:
# apk add postgresql-dev
You can also try to install psycopg2 using pip,
% pip install psycopg2-binary
Read More: https://www.psycopg.org/docs/install.html

Have Questions? Post them here!
- tkinter - Hello World! Program
- How to install Python Specific version (3.8, 3.9 or 3.10) using Brew
- How to install SpaCy (NLP Library) on Mac
- Python matplotlib segmentation fault: 11 macOS Big Sur
- How to uninstall pip Python packages
- 3 Ways to find if element is present in a List in Python
- How to Convert Python String to DateTime Object
- Python f-strings Formatted String Literals Syntax and Examples
- Where does brew install python in macOS
- Take input argument from command line in Python Programming
- Advanced print() Function Tutorial and Techniques for Python Developers
- How to add borders to tkinter label text
- Whats new in Python 3.10 Pre-release
- Float built-in function in Python
- List of All 35 Reserved Keywords in Python Programming Language 3.11
- How to check if Key Exists in Python Dictionary?
- Read a file line by line in Python Program
- ModuleNotFoundError: No module named qdarkstyle.colorsystem [Python]
- What is the Max and Minimum Value of int type in Python?
- What is Terminal Velocity and its Formula? How to calculate it programmatically?
- Fix: TypeError: can only concatenate str (not int) to str in Python
- How to take user input from the console in a Python program
- [Fix] TypeError: str object is not callable in Python
- 3 Python program to add two numbers
- How to delete a file using Python code example
- How to Print from JavaScript HTML using window.print - JavaScript
- git fatal: Authentication failed error [fix] - Git
- Most Essencial AWS CLI 2 S3 ls Command Options - AWS
- Install Bash Completion on macOS - Bash
- List of Code Snippets/Templates to Eclipse IDE - Eclipse
- Installing brew on M1/M2 ARM Mac - MacOS
- Git Remove Untracked Files using Command - Git
- Check Android Studio App is M1/M2 Chip based post installation - Android-Studio