Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jioQk-0001gu-Vt for pgsql-general@arkaria.postgresql.org; Wed, 10 Jun 2020 00:17:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jioQj-0007eD-OH for pgsql-general@arkaria.postgresql.org; Wed, 10 Jun 2020 00:17:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jioQi-0007e1-Lh for pgsql-general@lists.postgresql.org; Wed, 10 Jun 2020 00:17:21 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jioQg-00034H-2m for pgsql-general@lists.postgresql.org; Wed, 10 Jun 2020 00:17:19 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3246C5C010C; Tue, 9 Jun 2020 20:17:17 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 09 Jun 2020 20:17:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=5 TNKK9p0OP5xREDCHb3s3fU72YkIR2V+nhN/8pI05lI=; b=n2o+uluZg/pRSaFeN f8ZzzG0yUxbyP8qUVXQ9rh2e4Jvc97jlnFvoa3Ljmh7D0Zio4iibLmxPxFFtxQrP nzpMsm91u0ifPFuazHIo6UpXgSClV0CzfKv6TJVqZ0f3JxKVkhyHoooykbq6+X+F l8iNiBXElXTIHqfv3bg4MzBaO3WOGRYUVGclrxuO35Q85asaL23D/M+9tdnR5LxO FOVEFC9DuxDYTgLNXxRiI1IzM/PnFKXGzYbtypztOCPIRG5UhYJk3IIfgM3gObJl H1sgU1Ewp8PSjs8PPoEE1vKu4e9BlJD4odpZ0JOt+deZ5QRfOiUtL/BjaBeRqa++ zNPJA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=5TNKK9p0OP5xREDCHb3s3fU72YkIR2V+nhN/8pI05 lI=; b=GCfIlzc+h6yHQCzA3fgfK1wN5o6R0jSWmfyoLyM8LFvwZwRfYzcy53Sq1 qL2LaxSnxl60EvwtCwdnBtEhT2Zm0MNzRrAlKPoDqq34oDJEVQHDbGkfOz6fOVEk JSuSSRJRHSrYvFuqBsDbZ7xZTzjQZkIVzyZl/gUl47NqfyGW7rEOQTW8dwNzaU0f aE/VM7OYy+e1WM7AnkKZ+V18aiy82VYsAQKSq+sJ0zrON4PmtxmewME9L2jspGfe 9Fs+ogn4xa+Wb5OITH6iMT9EqcfWb+MnX8+CJzyjbhYYkqCZ2LhbIqmOJVYxoDua V4ixa8AH+J1cYCDoBir6udSXVDSXQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudehhedgfedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeevveefveefueegffekkefhgeeiueffgfetueejvdfg hfeujeejhfekjeelgedtgeenucfkphepjeehrddujedvrdehrddvfedunecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgr vhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: from [192.168.1.3] (75-172-5-231.tukw.qwest.net [75.172.5.231]) by mail.messagingengine.com (Postfix) with ESMTPA id 532B3306218B; Tue, 9 Jun 2020 20:17:16 -0400 (EDT) Subject: Re: Help with plpython3u To: PEDRO PABLO SEVERIN HONORATO , pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: <630c303b-1c82-90dc-b602-54e461335fc6@aklaver.com> Date: Tue, 9 Jun 2020 17:17:15 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 6/9/20 5:09 PM, PEDRO PABLO SEVERIN HONORATO wrote: > Hello! > > I'm cracking my head while trying to make python language work within > postges. I executed "*create extension plpython3u*" but I get this error: > > "*ERROR: could not load library "C:/Program > Files/PostgreSQL/12/lib/plpython3.dll": The specified module could not > be found. SQL state: 58P01*" > > Looking into several stackoverflow pages and asking like everywhere, I > also installed dependency walker and saw that python37.dll was required. > My PC already has python 3.7.4, but I don't know if that is an issue and > postgres requires python 3.7.0 strictly. > > I also copied the python37.dll file directly in the System32 folder, as > some pages suggested. That actually made it possible to run the > "* create extension plpython3u* ", but when I try to create a simple > function like: > > "*CREATE FUNCTION pymax (a integer, b integer)* > *  RETURNS integer > AS $$ >   if a > b: >     return a >   return b > * > *$$ LANGUAGE plpython3u*;" > > The server crashes and I get this message: "*Connection to the server > has been lost*." > > Some additional information: > - My PC is running windows server 2019 64 bits (its a vps) How did you install Postgres? > - The python version I have is 3.7.4. Installed it with Anaconda Unless things have changed since the last time I used Anaconda, it basically creates virtualenvs for it's installs. So when you refer to the Python dll above are you talking about a system installed one or one from within the Anaconda environment? > - Postgres version is 12.2-1. pgAdmin is 4.18 > > Please, help me :( > Regards, > PS -- Adrian Klaver adrian.klaver@aklaver.com