I am trying to run a Python script in PostgreSQL in a Windows 10 environment.
create extension if not exists plpython3u;
throws
ERROR: could not load library "C:/Program Files/PostgreSQL/14/lib/plpython3.dll": The specified module could not be found.
How can I solve this?
Here is a log file:
`Program Files\\PostgreSQL\\14\\bin\\postgres.exe'
sys.prefix = 'C:\\edb\\languagepack-9.6\\x64\\Python-3.3'
sys.exec_prefix = 'C:\\edb\\languagepack-9.6\\x64\\Python-3.3'
sys.path = [
'C:\\edb\\languagepack\\v2\\Python-3.9\\Lib\\encodings',
'C:\\Python39\\python39.zip',
'C:\\edb\\languagepack-9.6\\x64\\Python-3.3\\DLLs',
'C:\\Python path configuration:
PYTHONHOME = 'C:\edb\languagepack-9.6\x64\Python-3.3'
PYTHONPATH = 'C:\edb\languagepack\v2\Python-3.9\Lib\encodings'
program name = 'python'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = 'C:\\Program Files\\PostgreSQL\\14\\bin\\postgres.exe'
sys.base_prefix = 'C:\\edb\\languagepack-9.6\\x64\\Python-3.3'
sys.base_exec_prefix = 'C:\\edb\\languagepack-9.6\\x64\\Python-3.3'
sys.platlibdir = 'lib'
sys.executable = 'C:\\edb\\languagepack-9.6\\x64\\Python-3.3\\lib',
'C:\\Program Files\\PostgreSQL\\14\\bin',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'