Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8336089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:52:45+00:00 2026-06-09T03:52:45+00:00

I’m trying to get psycopg2 working on ML, default Python 2.7 (2.7.2). I installed

  • 0

I’m trying to get psycopg2 working on ML, default Python 2.7 (2.7.2). I installed postgresql via homebrew, and psycopg2 with pip. Postgres is happily up and running, and PGAdmin3 can see the db I made.

But when I run python and try

import psycopg2

I get:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/psycopg2/__init__.py", line 67, in <module>
    from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: dlopen(/Library/Python/2.7/site-packages/psycopg2/_psycopg.so, 2): Symbol not     found: _PQbackendPID
  Referenced from: /Library/Python/2.7/site-packages/psycopg2/_psycopg.so
  Expected in: flat namespace
 in /Library/Python/2.7/site-packages/psycopg2/_psycopg.so

Now the output for sudo pip install psycopg2 isn’t exactly clean. Clang gives a bunch of warnings, but no errors:

warning: argument unused during compilation: ‘-mno-fused-madd’
warning: unused function ‘Dprintf’
warning: implicit conversion loses integer precision: ‘long’ to ‘int’
warning: comparison of unsigned expression < 0 is always false
ld: warning: ignoring file /usr/local/Cellar/postgresql/9.1.4/lib/libpq.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /usr/local/Cellar/postgresql/9.1.4/lib/libpq.dylib

That last linker warning has me worried though, and I’m wondering if its the old 32-vs-64 bit Python problem again. I’ve tried the old:

defaults write com.apple.versioner.python Prefer-32-Bit -bool yes

But no dice.

My next thoughts are: force brew to compile postgresql as x86_64, or install python from brew. I’d like the first choice, because I have some other software (sigh) that depends on Apple’s Python being first in PATH.

Any ideas how to make postgresql compile as 64-bit using brew?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T03:52:47+00:00Added an answer on June 9, 2026 at 3:52 am

    As @Doughal pointed out, I was running 32-bit Python already, and the library wanted 64-bit. So, fixed with a simple

    defaults write com.apple.versioner.python Prefer-32-Bit -bool no
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am currently running into a problem where an element is coming back from
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.