Error Installing Psycopg2 on MacOS 10.9.5
I ran pip install psycopg2-binary
and it worked like charm
More info about the binary package
Python 3
pip3 install psycopg2-binary
Error when installing psycopg2 for my Mac
"please install the PyPI 'psycopg2-binary'"
You can do this by running the following
pip install psycopg2-binary
Python( Django ) pip install psycopg2 error in MacOS
I think you don't have Postgres installed, you can install by using
brew install postgresql
that helps your problem. after that, you can install pip dependency packages
How to install psycopg2 with pip on Python?
Note: Since a while back, there are binary wheels for Windows in PyPI, so this should no longer be an issue for Windows users. Below are solutions for Linux, Mac users, since lots of them find this post through web searches.
Option 1
Install the psycopg2-binary
PyPI package instead, it has Python wheels for Linux and Mac OS.
pip install psycopg2-binary
Option 2
Install the prerequsisites for building the psycopg2
package from source:
Debian/Ubuntu
Python 3
sudo apt install libpq-dev python3-dev
You might need to install python3.8-dev
or similar for e.g. Python 3.8.
Python 2
sudo apt install libpq-dev python-dev
If that's not enough, try
sudo apt install build-essential
or
sudo apt install postgresql-server-dev-all
as well before installing psycopg2 again.
CentOS 6
See Banjer's answer
macOS
See nichochar's answer
Related Topics
CSV New-Line Character Seen in Unquoted Field Error
Matplotlib - Extracting Data from Contour Lines
Matplotlib: Draw Grid Lines Behind Other Graph Elements
Python Pandas Group by Date Using Datetime Data
Cleanest Way to Hide Every Nth Tick Label in Matplotlib Colorbar
Replace String Within File Contents
Why Is the Time Complexity of Python's List.Append() Method O(1)
Pip Install Gives Error: Unable to Find Vcvarsall.Bat
What Does a Leading '\X' Mean in a Python String '\Xaa'
Passing a Data Frame Column and External List to Udf Under Withcolumn
Python Command Line Input in a Process
Add Zeros to a Float After the Decimal Point in Python
Reading the Target of a .Lnk File in Python
Transform "List of Tuples" into a Flat List or a Matrix
Python Time to Age, Part 2: Timezones