Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fGT3W-00061h-4l for pgsql-general@arkaria.postgresql.org; Wed, 09 May 2018 17:39:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fGT3U-00020I-Vp for pgsql-general@arkaria.postgresql.org; Wed, 09 May 2018 17:39:08 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fGT3U-000209-KD for pgsql-general@lists.postgresql.org; Wed, 09 May 2018 17:39:08 +0000 Received: from mx0b-00151a02.pphosted.com ([67.231.156.68]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fGT3R-0000pr-0n for pgsql-general@lists.postgresql.org; Wed, 09 May 2018 17:39:06 +0000 Received: from pps.filterd (m0046990.ppops.net [127.0.0.1]) by mx0b-.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w49HZ2TF020193; Wed, 9 May 2018 10:39:00 -0700 Received: from esrismtp2.esri.com (esrismtp2.esri.com [198.102.62.103]) by mx0b-.pphosted.com with ESMTP id 2humfnafhx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 May 2018 10:39:00 -0700 Received: from mail.esri.com (red-inf-mxmb-p1.esri.com [10.50.4.253]) by red-inf-smtp-p1.esri.com (8.14.4/8.14.4) with ESMTP id w49HcxAZ030946 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 9 May 2018 10:38:59 -0700 Received: from RED-INF-MXMB-P2.esri.com (10.50.4.255) by RED-INF-MXMB-P1.esri.com (10.50.4.253) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 9 May 2018 10:38:57 -0700 Received: from RED-INF-MXMB-P2.esri.com ([fe80::7dba:fa89:7914:7c91]) by RED-INF-MXMB-P2.esri.com ([fe80::7dba:fa89:7914:7c91%15]) with mapi id 15.00.1347.000; Wed, 9 May 2018 10:38:58 -0700 From: Bruce Harold To: Adrian Klaver , "pgsql-general@lists.postgresql.org" Subject: RE: Error creating plpython3u extension Thread-Topic: Error creating plpython3u extension Thread-Index: AdPnCaDsY9jXzJvoTfiTCbbSngJLogATkdqAABck9ZAAAfjskA== Date: Wed, 9 May 2018 17:38:57 +0000 Message-ID: <2563d2ff74844fd19c85c54a228cf740@RED-INF-MXMB-P2.esri.com> References: <1a78dde41c8e4b3a9566c6bf44607b66@RED-INF-MXMB-P2.esri.com> In-Reply-To: <1a78dde41c8e4b3a9566c6bf44607b66@RED-INF-MXMB-P2.esri.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.50.254.250] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-09_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805090165 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk It seems my cheap hack doesn't work, the server connection breaks on CREATE= FUNCTION unless PYTHONHOME is set for the system. -----Original Message----- From: Bruce Harold=20 Sent: Wednesday, May 9, 2018 9:46 AM To: 'Adrian Klaver' ; pgsql-general@lists.postgr= esql.org Subject: RE: Error creating plpython3u extension Thank you Adrian and Jeff. I made some progress and can extend databases with plpython3u. Re. the edb doc, "C:\edb\LanguagePack-10\x64\Python-3.4\bin" does not exist= , stripping 'bin' off the path is required. Setting PYTHONHOME for the system is unfriendly to the rest of my python de= pendencies, so to make this specific to pg I edited the pgAdmin 4 shortcut = to set the variable there, the shortcut target becomes:=20 C:\Windows\System32\cmd.exe /c "SET PYTHONHOME=3DC:\edb\languagepack-10\x64= \Python-3.4 && START pgAdmin4.exe" The "Start in" property does not change, the executable is found. Whether or not this works across the server I guess I'll find out shortly, = I'm a newbie doing a proof of concept so deployment isn't a concern. Bruce -----Original Message----- From: Adrian Klaver [mailto:adrian.klaver@aklaver.com] Sent: Tuesday, May 8, 2018 3:38 PM To: Bruce Harold ; pgsql-general@lists.postgresql.org Subject: Re: Error creating plpython3u extension On 05/08/2018 01:28 PM, Bruce Harold wrote: > Hi >=20 > I have PostgreSQL 10 on Windows 10 and the EDB language pack X64 for=20 > Python 3.4 etc. >=20 > I edited the *system* environment variables: According to this: https://urldefense.proofpoint.com/v2/url?u=3Dhttps-3A__www.enterprisedb.com= _docs_en_10.0_Language-5FPack-5Fv10_EDB-5FPostgres-5FLanguage-5FPack-5FGuid= e.1.08.html&d=3DDwIC-g&c=3Dn6-cguzQvX_tUIrZOS_4Og&r=3DnRgKzHukYnMuxsKJmL-jR= A&m=3DA89phKNv5UT7bfmJVcGEJawoPPWKYHm4vDtVUer15Lk&s=3Dd0WYDSstKd642xdAtngF9= suS84SpG9PZibyLpTmPjUo&e=3D This: >=20 > PYTHONPATH =3D C:\edb\languagepack-10\x64\Python-3.4 should be: set PYTHONHOME=3DC:\edb\languagepack-10\x64\Python-3.4 >=20 > Added C:\edb\LanguagePack-10\x64\Python-3.4\bin to PATH >=20 > Creating the extension plpython3u errors: >=20 > ERROR: could not load library "C:/Program > Files/PostgreSQL/10/lib/plpython3.dll": The specified module could not=20 > be found >=20 > I have conda on the same machine with one Python 3.6 environment, I=20 > tried adding a Python 3.4 environment with conda but no luck there either= . >=20 > Anyone have any experience enabling plpython3u in a conda environment? >=20 > Thanks >=20 > Bruce >=20 -- Adrian Klaver adrian.klaver@aklaver.com