HisAbimbola     About     Archive     Feed

Fix error with psycopg2 when setting up django with postgres

Recently, I wanted to start a Django project, and this time I decided to use PostgreSQL as my database instead of SQLite, and I ran into this error when I run

python -c "import psycopg2"

to confirm if Postgres has be set up correctly.

Screen Shot 2015-06-24 at 12.05.49 PM

After several searches and trying out several solutions, saw this post on stackOverflow where I was told to run this command

sudo mv /usr/lib/libpq.5.dylib /usr/lib/libpq.5.dylib.old

sudo ln -s Applications/Postgres.app/Contents/Versions/9.4/lib/libpq.5.dylib /usr/lib

So I did that, and it fixed the issue.

I hope this post helps someone and save you of hours of debugging and thanks to my colleagues Ifedapo and Eniola that helped me in solving this and other issues I had when setting up. Gracias

If you liked this post, you can share it with your followers or follow me on Twitter!