I had Python 3.13 and got the same error when tried to install psycopg2-binary. I downgrade Python to 3.12 as per FlyingTeller recommendation and it fixed the error. Please see the answer on how to downgrade Python: https://stackoverflow.com/a/75710481/15400268