2

I'm trying to install psycopg2 but pip install psycopg2 brings to error: command 'gcc' failed with exit status 1

Command line tools are installed

MacOS 10.15

2
  • Could you please post the complete error message? Commented Nov 10, 2019 at 15:55
  • 1
    Install using the binary directly pip install psycopg2-binary Commented Nov 10, 2019 at 18:53

2 Answers 2

4

This is likely because you don't have the PostgreSQL devel library installed. You have a few options:

(1) Install the binary with pip install psycopg2-binary (2) Install PostgreSQL with HomeBrew: brew install postgresql, then pip install psycopg2.

You can probably just install the binary.

Sign up to request clarification or add additional context in comments.

Comments

0

after updating the pip package error went away

To Update python3 pip package

wget https://bootstrap.pypa.io/get-pip.py
 
/usr/bin/python3 get-pip.py 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.