Skip site navigation (1) Skip section navigation (2)

Re: Problems with Python 3.2.

From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: Nicklas Börjesson <Nicklas(dot)Borjesson(at)ws(dot)se>
Cc: psycopg(at)postgresql(dot)org
Subject: Re: Problems with Python 3.2.
Date: 2011-09-26 05:13:45
Message-ID: (view raw, whole thread or download thread mbox)
Lists: psycopg
2011/9/25 Nicklas Börjesson <Nicklas(dot)Borjesson(at)ws(dot)se>:
> Hi all,
> My name is Nicklas, new to the list.

Hi Nicklas, nice to read yo.

> Well I'll get to it, I try and import psycopg2 using Python 3.2, and then I get this error:
>  File "/", line 46, in ConnectToDB
>    import psycopg2
>  File "/usr/local/lib/python3.2/dist-packages/psycopg2/", line 67, in <module>
>    from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
> ImportError: /usr/local/lib/python3.2/dist-packages/psycopg2/ undefined symbol: _Py_ZeroStruct
> Since i have multiple python versions, I have simply build the package(python build) and copied the contents to the place where packages seem to end up(/usr/local/lib/python3.2/dist-packages/).

You are building psycopg with the wrong python. try /path/to/python3.2 build and then copy that library into the right library. to
know which one execute py 3.2 again and check the sys.path.

> I am having a similar problem with pyodbc.

You have the same problem there: it's not psycopg2 specific.

-- Daniele

In response to

psycopg by date

Next:From: Grant McKenzieDate: 2011-09-29 14:36:38
Subject: Cursor copy_from with server crash
Previous:From: Nicklas BörjessonDate: 2011-09-25 21:25:16
Subject: Problems with Python 3.2.

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group