Issue
I can't install psycopg2 on my m1 Mac. I tried to reinstall openssl with brew. I tried a lot of thing but nothing changed. The error log is super long so I couldn't understand what is wrong. I am facing up with this error when I try to pip install psycopg2
Waiting for your help.
Here is the full error log: https://wtools.io/paste-code/b4jG
Solution
The error is happening because it seems to be having some problem with ssl. I used different answers from a similar question to solve it for myself:
Install openssl if you don't have:
brew install openssl
Check the path where openssl got installed using:
brew --prefix openssl
Use output from above and add LD flag when running the pip command, for example in my case the output was
/opt/homebrew/opt/[email protected]
so I did the following:LDFLAGS="-I/opt/homebrew/opt/[email protected]/include -L/opt/homebrew/opt/[email protected]/lib" pip install psycopg2
And that did the trick for me.
Answered By - Saravanan Setty
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.