Re: configure PostgreSQL with the python: distutils module not found - Mailing list pgsql-general

From Andre Mikulec
Subject Re: configure PostgreSQL with the python: distutils module not found
Date
Msg-id CY1PR03MB21875AB9B40FC9E03899AF5B9CD40@CY1PR03MB2187.namprd03.prod.outlook.com
Whole thread Raw
In response to Re: configure PostgreSQL with the python: distutils module not found  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general

Tom,

O.K., 

I re-wrote my ./configure to start with

./configure PYTHON=/c/EnterpriseDB/LanguagePack/9.5/x64/Python-3.3/python.exe ... etc ...

Thanks that works right now.

checking for python... /c/EnterpriseDB/LanguagePack/9.5/x64/Python-3.3/python.exe
checking for Python distutils module... yes
checking Python configuration directory...
checking Python include directories... -Ic:/EnterpriseDB/LanguagePack/9.5/x64/Python-3.3/include
checking how to link an embedded Python application... -L -lpython3.3

Maybe the docs should say, something similar to

"Full path name and file name of the XXX interpreter"?
https://www.postgresql.org/docs/9.5/static/install-procedure.html

I also ended up needing. . . .

1. A copy of python33.dll to be in the folder C:\Windows\System32.
(This 'location requirement' seems *stangely* hardcoded.)

2. pexports.exe ( that the mingw x86_64-6.2.0-release-posix-seh-rt_v5-rev0 does not have.)
I ended up attaching the 'PostgreSQL happy' Strawberry PERL distribution c_bin_directory
(that has pexports.exe ) to the end of my path.

set PATH=%PATH%;C:\Strawberry\c\bin

(But this guy know how to get pexports.exe directly)
MinGW: pexports for Windows DLLs
https://forbharat.wordpress.com/2010/12/30/mingw-pexports-for-windows-dlls/

I followed the instructions in here.
http://get.enterprisedb.com/docs/README-languagepack-950.txt

Then, I did.

create language plpython3u;

I followed the instructions in here.
https://www.postgresql.org/docs/9.5/static/plpython-funcs.html

Last, I did a very simple test.

postgres=# select pymax(5,3);
 pymax
-------
     5
(1 row)

Thanks,
Andre Mikulec
Andre_Mikulec@Hotmail.com




From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Thursday, October 20, 2016 10:03 AM
To: Andre Mikulec
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] configure PostgreSQL with the python: distutils module not found
 
Andre Mikulec <andre_mikulec@hotmail.com> writes:
> I am trying to configure PostgreSQL with the plpython language available.

> Here is my ./configure line

> $ ./configure PYTHON=/c/EnterpriseDB/LanguagePack/9.5/x64/Python-3.3 --with-python --with-includes=/c/EnterpriseDB/Lang

Are you sure that that PYTHON specification actually points at a usable
executable?

> I am getting the error message.

> checking for python... /c/EnterpriseDB/LanguagePack/9.5/x64/Python-3.3
> checking for Python distutils module... no
> configure: error: distutils module not found

The test that's failing is just

if "${PYTHON}" -c 'import distutils' 2>&AS_MESSAGE_LOG_FD
then
    AC_MSG_RESULT(yes)
else
    AC_MSG_RESULT(no)
    AC_MSG_ERROR([distutils module not found])
fi

so it seems pretty likely that the value of PYTHON you're forcing doesn't
identify a usable Python.  Looking into config.log to see what the stderr
output of this test was might be informative.

                        regards, tom lane

pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .
Next
From: wd
Date:
Subject: Re: Postgres upgrade from 9.4.9 to 9.6 using pg_upgrade error