X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9A5C355117; Mon, 7 Mar 2005 07:33:41 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 46989-06; Mon, 7 Mar 2005 07:33:33 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 58039563A1; Mon, 7 Mar 2005 07:33:32 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j277XHNh009110 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 7 Mar 2005 00:33:20 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j277XHCE024121; Mon, 7 Mar 2005 00:33:17 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j277XH0Z024120; Mon, 7 Mar 2005 00:33:17 -0700 (MST) (envelope-from mfuhr) Date: Mon, 7 Mar 2005 00:33:16 -0700 From: Michael Fuhr To: Wolfgang Keller Cc: pgsql-novice@postgresql.org, pgsql-interfaces@postgresql.org Subject: Re: [NOVICE] Python modules for PL/Python? Message-ID: <20050307073316.GA23982@winnie.fuhr.org> References: <20050306192632.GB8834@winnie.fuhr.org> <81wj7n129ysu$.1sn8d1un8kgdx$.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <81wj7n129ysu$.1sn8d1un8kgdx$.dlg@40tude.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/21 X-Sequence-Number: 5350 On Mon, Mar 07, 2005 at 07:39:53AM +0100, Wolfgang Keller wrote: > >> potentially dumb question: if I want to use non-standard Python modules > >> within PL/Python, I guess I have to recompile something (plpython.dll in > >> the /lib folder)? > > > > Are you having trouble using a module from a PL/Python function? > > Oops, I didn't even try to use anything non-standard... So try something :-) If you have problems then please report what you did and what happened. > I stupidly assumed that Postgres comes with its own Python interpreter > compiled-in...? No, at least not on Unix-like platforms. PL/Python is a shared object (plpython.so) that's linked against libpython, which is the Python runtime library for whatever version of Python you have installed. That library should be able to find modules in the same module search path (sys.path) that an ordinary Python program uses. -- Michael Fuhr http://www.fuhr.org/~mfuhr/