I've been working on FHIR for a project and we are using PostgreSQL as a database. While reading docs, I've come to know about PL/Python and decided to give it a shot but I am unable to install the python extension.
When I run the command CREATE EXTENSION pypthon3u;
I get the following error
Could not load library "C:/Program Files/PostgreSQL/12/lib/plpython3.dll": The specified module could not be found.
I've checked this SO answer but it couldn't help.
My PostgreSQL version: PostgreSQL 12.2, compiled by Visual C++ build 1914, 64-bit
Installed Python version: 3.7.7 (64 Bit)
OS Info: Windows 10 Enterprise Version 1909 OS Build 18363.657
For me, it looks like incorrect version of Python but I'm installing python 3.7.* version against which PostgreSQL is compiled as specified in doc\installation-notes.html
inside the install directory.
Any help will be appreciated.
I was trying the same. Though I am no expert and my errors were a bit different, here are a few things to check:
share\extension\
, there should beplpython3u.control
andplpython3u--1.0.sql
to be able to doCREATE EXTENSION plpython3u;
lib\
, there should be aplpython3.dll
. This one is possibly created after the above step.lib\
is in yourPATH
.PYTHONHOME
should be set in either system/user environment, or should be set before the server start. It seems the version is not as much important as having this name set.plpython3.dll
seems to look for apython39.dll
but I could use it with a 3.8 installation.I used a zipped version of Postgres, so the following is my way to run the server.
PS: without
PYTHONHOME
, the server crashes. the server itself orpsql
restarts the server but I am not sure aboutpgAdmin
.