close

[Solved] Error: No module named psycopg2.extensions

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Error: No module named psycopg2.extensions in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Error: No module named psycopg2.extensions Error Occurs?

Today I get the following error Error: No module named psycopg2.extensions in python.

How To Solve Error: No module named psycopg2.extensions Error ?

  1. How To Solve Error: No module named psycopg2.extensions Error ?

    To Solve Error: No module named psycopg2.extensions Error For macOS Mojave just run pip install psycopg2-binary. Works fine for me, python version -> Python 3.7.2

  2. Error: No module named psycopg2.extensions

    To Solve Error: No module named psycopg2.extensions Error For macOS Mojave just run pip install psycopg2-binary. Works fine for me, python version -> Python 3.7.2

Solution 1

The first thing to do is to install the dependencies.

sudo apt-get build-dep python-psycopg2
sudo apt install python3-psycopg2 # Python 3

After that go inside your virtualenv and use:

pip install psycopg2-binary

Solution 2

For macOS Mojave just run pip install psycopg2-binary. Works fine for me, python version -> Python 3.7.2

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read