Problem in installing PyGreSQL

Scott David Daniels Scott.Daniels at Acm.Org
Fri Aug 7 16:08:59 CEST 2009

Dennis Lee Bieber wrote:
> On Thu, 6 Aug 2009 16:00:15 +0530, "Thangappan.M"
> <thangappan143 at> declaimed the following in
> gmane.comp.python.general:
>>   File "./", line 219, in finalize_options
>>     except (Warning, w):
>> NameError: global name 'w' is not defined
>> What would be the solution?
>> Otherwise can you tell how to install DB-API in debian machine.
> 	Sorry... 1) I run on WinXP; 2) I don't build packages, relying on
> pre-built binaries; 3) I run MySQL.
> 	However, based upon the examples in the Tutorial, that line should
> not have the (, ). A parenthesised (tuple) is suppose to contain a list
> of exceptions, and the parameter to catch the exception specifics has to
> be outside the list.
> 	Best I can suggest is editing that particular line and removing the
> (, ) -- then try rebuilding.
> 	I'll also re-ask: All you are installing is the Python adapter to
> the database. DO YOU HAVE A RUNNING PostgreSQL server that you can
> connect to?

Just to be a bit more explict:
Change file's line 219 from:
 >>     except (Warning, w):
to either (OK in Python 2.6 and greater):
        except Warning as w:
or (works for Python 2.X):
        except Warning, w:

--Scott David Daniels
Scott.Daniels at Acm.Org

More information about the Python-list mailing list