Error when installing psycopg2 on Windows 10

2024/9/27 19:25:18
Collecting psycopg2Using cached psycopg2-2.6.1.tar.gzComplete output from command python setup.py egg_info:running egg_infocreating pip-egg-info\psycopg2.egg-infowriting pip-egg-info\psycopg2.egg-info\PKG-INFOwriting top-level names to pip-egg-info\psycopg2.egg-info\top_level.txtwriting dependency_links to pip-egg-info\psycopg2.egg-info\dependency_links.txtwriting manifest file 'pip-egg-info\psycopg2.egg-info\SOURCES.txt'warning: manifest_maker: standard file '-c' not foundError: 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'.----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in 
C:\Users\peppe\AppData\Local\Temp\pip-build-599lt1cp\psycopg2\

Every time I attempt to run pip install psycopg2 I get the above error. I tried to download the compiled version, but when I run it, I get an error telling me Python 3.5 must be installed. I have Python 3.5 x86 installed, and I downloaded the x86 version of psycopg2 to match it, so I really cannot find a solution. Anyone have any ideas? I am running Windows 10.

Answer

Installed psycopg2 on Windows 10 without issues:

pip install psycopg2

Ensure you have the PostgreSQL executables incl. DLL's in your PATH:

%PG_HOME%\bin;%PG_HOME%\lib
https://en.xdnf.cn/q/71425.html

Related Q&A

Speeding up Pandas apply function

For a relatively big Pandas DataFrame (a few 100k rows), Id like to create a series that is a result of an apply function. The problem is that the function is not very fast and I was hoping that it can…

Numpy repeat for 2d array

Given two arrays, say arr = array([10, 24, 24, 24, 1, 21, 1, 21, 0, 0], dtype=int32) rep = array([3, 2, 2, 0, 0, 0, 0, 0, 0, 0], dtype=int32)np.repeat(arr, rep) returns array([10, 10, 10, 24, 24, 2…

Python Linux route table lookup

I posted Python find first network hop about trying to find the first hop and the more I thought about it, the easier it seemed like it would be a process the routing table in python. Im not a program…

How to compare frequencies/sampling rates in pandas?

is there a way to say that 13Min is > 59S and <2H using the frequency notation in pandas?

Why do I get expected an indented block when I try to run my Python script? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.Closed 5 years ago.Edit the question to include desired behavior, a specific problem or error, and t…

python run command as normal user in a root script

I have a python script that is launched as root, I cant change it. I would like to know if its possible to exectute certain lines of this script (or all the script) as normal user (I dont need to be ro…

Compare values of two arrays in python

How can i check if item in b is in a and the found match item in a should not be use in the next matching? Currently this code will match both 2 in b.a = [3,2,5,4] b = [2,4,2]for i in b:if i in a:prin…

How to count the number of digits in numbers in different bases?

Im working with numbers in different bases (base-10, base-8, base-16, etc). Im trying to count the number of characters in each number. ExampleNumber: ABCDEF Number of digits: 6I know about the method …

Pandas KeyError using pivot

Im new to Python and I would like to use Python to replicate a common excel task. If such a question has already been answered, please let me know. Ive been unable to find it. I have the following p…

Not found: Container localhost does not exist when I load model with tensorflow and flask

I am a newbie research Deeplearning. I load a saved model with tensorflow and made a API with flask but I get error Container localhost does not exist. when I predict, please help me fix it. Thank you.…