Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install psycopg2 (pip install psycopg2)

I'm using MAC and python version 2.7.14

Collecting psycopg2   Could not fetch URL https://pypi.python.org/simple/psycopg2/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:661) - skipping   Could not find a version that satisfies the requirement psycopg2 (from versions: ) No matching distribution found for psycopg2 
like image 208
Rakesh Kumar Avatar asked Apr 13 '18 07:04

Rakesh Kumar


People also ask

Does psycopg2 work with Python 3?

The current psycopg2 implementation supports: Python 2 versions from 2.6 to 2.7. Python 3 versions from 3.2 to 3.6. PostgreSQL server versions from 7.4 to 9.6.

What is psycopg2-binary in Python?

Psycopg is the most popular PostgreSQL database adapter for the Python programming language. Its main features are the complete implementation of the Python DB API 2.0 specification and the thread safety (several threads can share the same connection).

Could not find a version that satisfies the requirement psycopg2-binary from versions?

Queries related to “could not find a version that satisfies the requirement psycopg2” You may install a binary package by installing 'psycopg2-binary' from PyPI. If you want to install psycopg2 from source, please install the packages required for the build and try again. PyPI 'psycopg2-binary' package instead.


2 Answers

Try this:

pip install psycopg2-binary 
like image 97
ryche Avatar answered Sep 21 '22 09:09

ryche


Same issue, forgot to install psql: https://wiki.postgresql.org/wiki/Homebrew

So i ran:

brew install postgresql brew services start postgresql 
like image 32
Daniel Lagiň Avatar answered Sep 20 '22 09:09

Daniel Lagiň