+2 votes
in Databases by (11.2k points)
edited by

I tried to install Psycopg2 using pip install Psycopg2 and conda install Psycopg2 for Anaconda running on my Windows system, but when I try to connect to postgresql database in python 3 code, i get error - python27.dll is not compatible with the current version of python.

How can I install the correct version of Psycopg2?

1 Answer

+1 vote
by (11.2k points)
edited by

It seems that pip/conda didn't install the correct version of psycopg2 on your machine. Do the followings to install the correct version of psycopg2.

  • Download the correct version of .whl file from https://pypi.python.org/pypi/psycopg2. Suppose you have python 3.5 on your machine, download psycopg2-2.6.2-cp35-none-win32.whl (md5) or psycopg2-2.6.2-cp35-none-win_amd64.whl (md5) depending on 32-bit/64-bit of OS.
  • Open command prompt and use CD command to point to the folder where you downloaded the file.
  • then type pip install filename . filename is the file your downloaded. e.g. pip install psycopg2-2.6.2-cp35-none-win32.whl

Related questions

+2 votes
1 answer
+2 votes
1 answer
+3 votes
1 answer
+2 votes
1 answer
asked Aug 14, 2018 in General by pythonuser (8.2k points)
+2 votes
1 answer
...