From: Iain Barnett on
Hi,

Would anyone know if it's possible to install psycopg2-2.0.13 with python3.1.1 (or similar)? When I try I get the following

$ sudo python setup.py install
Password:
File "setup.py", line 233
except Warning, w:
^
SyntaxError: invalid syntax


I can install it with python2.6 with no problems, but obviously I'd prefer to use the latest version. My system is OSX10.6, and I'm new to Python.


Any help is much appreciated.

Iain

From: Philip Semanchuk on

On Jan 20, 2010, at 5:45 PM, Iain Barnett wrote:

> Hi,
>
> Would anyone know if it's possible to install psycopg2-2.0.13 with
> python3.1.1 (or similar)? When I try I get the following
>
> $ sudo python setup.py install
> Password:
> File "setup.py", line 233
> except Warning, w:
> ^
> SyntaxError: invalid syntax
>
>
> I can install it with python2.6 with no problems, but obviously I'd
> prefer to use the latest version. My system is OSX10.6, and I'm new
> to Python.

Hi Iain,
I've been out of the psycopg loop for a while now, but my guess is
that the answer to your question is no. There are some Python 3-
related checkins in the psycopg2 repository, but it looks like they're
not ready for public use yet (unless you're adventurous).

Here's the source repository, which contains a commit commented "First
round of changes for Python 3":
https://dndg.it/cgi-bin/gitweb.cgi?p=public/psycopg2.git

If you scroll to the bottom of that page you'll see a "head" created
especially for Python 2 which is where 2.0.13 came from.

If you're willing to do some hacking on your own, Martin v. Löwis
ported psycopg2 to Python 3 and provided a diff:
http://mail.python.org/pipermail/python-porting/2008-December/000018.html

Last but not least, I should note that psycopg has its own mailing
list, and I bet they know more about it there:
http://lists.initd.org/mailman/listinfo/psycopg

Hope this helps. Psycopg & Postgres both worked wonderfully well for me.

Cheers
Philip
From: Gabriel Genellina on
En Wed, 20 Jan 2010 19:45:44 -0300, Iain Barnett <iainspeed(a)gmail.com>
escribi�:

> Would anyone know if it's possible to install psycopg2-2.0.13 with
> python3.1.1 (or similar)?I can install it with python2.6 with no
> problems, but obviously I'd prefer to use the latest version. My system
> is OSX10.6, and I'm new to Python.

If you're new to Python, perhaps it's better to stay with the 2.6 version.

Python 3.x introduced some incompatible changes in the language; not all
third-party packages are available for Python 3.x yet. Regarding psycopg2,
although some work has been done [1], there is no "official" release
compatible with Python 3 yet.

If you insist on using Python 3.1, there is another interface to
PostgreSQL called pg8000 that claims to be Python 3.x compatible (I've not
actually tested it).

[1]
http://mail.python.org/pipermail/python-porting/2008-December/000004.html
[2] http://pybrary.net/pg8000/

--
Gabriel Genellina

From: Iain Barnett on

On 21 Jan 2010, at 00:11, Gabriel Genellina wrote:

> En Wed, 20 Jan 2010 19:45:44 -0300, Iain Barnett <iainspeed(a)gmail.com> escribió:
>
>> Would anyone know if it's possible to install psycopg2-2.0.13 with python3.1.1 (or similar)?I can install it with python2.6 with no problems, but obviously I'd prefer to use the latest version. My system is OSX10.6, and I'm new to Python.
>
> If you're new to Python, perhaps it's better to stay with the 2.6 version.
>
> Python 3.x introduced some incompatible changes in the language; not all third-party packages are available for Python 3.x yet. Regarding psycopg2, although some work has been done [1], there is no "official" release compatible with Python 3 yet.
>
> If you insist on using Python 3.1, there is another interface to PostgreSQL called pg8000 that claims to be Python 3.x compatible (I've not actually tested it).
>
> [1] http://mail.python.org/pipermail/python-porting/2008-December/000004.html
> [2] http://pybrary.net/pg8000/
>
> --
> Gabriel Genellina
>
> --
> http://mail.python.org/mailman/listinfo/python-list

On 20 Jan 2010, at 23:58, Philip Semanchuk wrote:

>
> On Jan 20, 2010, at 5:45 PM, Iain Barnett wrote:
>
>> Hi,
>>
>> Would anyone know if it's possible to install psycopg2-2.0.13 with python3.1.1 (or similar)? When I try I get the following
>>
>> $ sudo python setup.py install
>> Password:
>> File "setup.py", line 233
>> except Warning, w:
>> ^
>> SyntaxError: invalid syntax
>>
>>
>> I can install it with python2.6 with no problems, but obviously I'd prefer to use the latest version. My system is OSX10.6, and I'm new to Python.
>
> Hi Iain,
> I've been out of the psycopg loop for a while now, but my guess is that the answer to your question is no. There are some Python 3-related checkins in the psycopg2 repository, but it looks like they're not ready for public use yet (unless you're adventurous).
>
> Here's the source repository, which contains a commit commented "First round of changes for Python 3":
> https://dndg.it/cgi-bin/gitweb.cgi?p=public/psycopg2.git
>
> If you scroll to the bottom of that page you'll see a "head" created especially for Python 2 which is where 2.0.13 came from.
>
> If you're willing to do some hacking on your own, Martin v. Löwis ported psycopg2 to Python 3 and provided a diff:
> http://mail.python.org/pipermail/python-porting/2008-December/000018.html
>
> Last but not least, I should note that psycopg has its own mailing list, and I bet they know more about it there:
> http://lists.initd.org/mailman/listinfo/psycopg
>
> Hope this helps. Psycopg & Postgres both worked wonderfully well for me.
>
> Cheers
> Philip
> --
> http://mail.python.org/mailman/listinfo/python-list

Thanks to both of you, it really is much appreciated.

Regards
Iain


From: Sibylle Koczian on
Iain Barnett schrieb:
> On 21 Jan 2010, at 00:11, Gabriel Genellina wrote:
>
>> If you insist on using Python 3.1, there is another interface to PostgreSQL called pg8000 that claims to be Python 3.x compatible (I've not actually tested it).
>>
>> [1] http://mail.python.org/pipermail/python-porting/2008-December/000004.html
>> [2] http://pybrary.net/pg8000/
>>

Or there is py-postgresql:

http://python.projects.postgresql.org/

I've not yet used it very much, but it seems to work quite well, is
reasonably documented and the mailing list is small and helpful.

HTH
Sibylle