Re: import error

From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: "Pervez, Salman" <Salman(dot)Pervez(at)citadelgroup(dot)com>
Cc: "psycopg(at)postgresql(dot)org" <psycopg(at)postgresql(dot)org>
Subject: Re: import error
Date: 2012-03-21 21:18:13
Message-ID: CA+mi_8ZiO4BOy-paQQGv5Cnz3JVsA7DBT+Vjg35-Xo5v0wJC_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

On Wed, Mar 21, 2012 at 8:54 PM, Pervez, Salman
<Salman(dot)Pervez(at)citadelgroup(dot)com> wrote:
> Hi everyone, I could use a little help debugging an error I am getting. I
> recently installed psycopg2-2.4.3. When I import the module I get this error
> from python.

> undefined symbol: PyByteArray_Type

Looks like you have compiled psycopg with Python 2.7.

> I feel like this might be a version mismatch error. I am using Python 2.4.3.
> But I have no idea which version of psycopg would be compatible with it. I
> will appreciate any help. Thanks!

Psycopg is compatible with Python 2.4. Just make sure you use the
right version when you build it:

/path/to/python2.4 setup.py build
sudo /path/to/python2.4 setup.py install

Take note of where the library is installed to. If you still get an
ImportError, check the path reported by the exception: you will likely
see that it's not the same path reported in installation. In this case
you may have to adjust the PYTHONPATH in order to avoid confusion
across the different python versions you have installed in your
system.

-- Daniele

In response to

Browse psycopg by date

  From Date Subject
Next Message Bill House 2012-03-25 00:03:36 Connection function
Previous Message Pervez, Salman 2012-03-21 20:54:46 import error