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

Re: [NOVICE] Python verison for build in (Win32)

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: James William Pye <lists(at)jwp(dot)name>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Matt <bsg075(at)gmail(dot)com>, pgsql-novice <pgsql-novice(at)postgresql(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [NOVICE] Python verison for build in (Win32)
Date: 2010-02-14 14:11:57
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-novice
2010/1/20 James William Pye <lists(at)jwp(dot)name>:
> On Jan 20, 2010, at 12:27 PM, Magnus Hagander wrote:
>> Well, it needs the version to match it to the DLL name. For python
>> 2.6, it needs python26.dll. But yes, there should probably be some way
>> to ask python itself about that - that would be the non-naive method.
>> But as long as python is installed per default, we got it for free,
>> which is why it has "worked so far".
> [on tom's question]
> IIRC, the reason you can't query Python in the same way that configure/python.m4 does is because the generated Makefile that supports distutils.sysconfig does not exist in standard win32 builds. That is, AFAIK, there is no way to request the exact path of the dll/lib file in win32. However, I'm not particularly familiar with Python on win32, so that may not be the case.
> Given the absence of a more precise method, I'd recommend considering something along the lines of:
> Allow the user specify ( the Python executable to build against and default to the python.exe in %PATH%. (this may already be the case, idk)
> Query Python for the version information and installation prefix.
>  python -c 'import sys; print(str(sys.version_info[0]) + str(sys.version_info[1]))'
>  python -c 'import sys; print(sys.prefix)'
> Assume that the prefix has a normal layout, and construct the lib path from the extracted version and prefix.

From what I can tell, it at least makes no assumptions worse than we
have now. I'm sure there are ways to break it :-), but I think there
are less than there are now.

I have applied a patch that does something like this.

 Magnus Hagander

In response to

pgsql-novice by date

Next:From: Mag GamDate: 2010-02-14 14:39:13
Subject: storing a text file
Previous:From: Devrim GÜNDÜZDate: 2010-02-14 00:23:19
Subject: Re: Vacuuming

pgsql-hackers by date

Next:From: Magnus HaganderDate: 2010-02-14 14:52:30
Subject: Re: Streaming Replication on win32
Previous:From: Greg StarkDate: 2010-02-14 14:03:44
Subject: Re: Re: Faster CREATE DATABASE by delaying fsync (was 8.4.1 ubuntu karmic slow createdb)

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