Skip to content Skip to sidebar Skip to footer

Error During: Create Extension Plpython3u; On Postgresql 9.6.0

I have installed PostgreSQL Server 9.6.0 and Python 3.4.2 on Windows 2012 R2 Server. I copied plpython3.dll to C:/Program Files/PostgreSQL/9.6/lib/ The in PostgreSQL I try running

Solution 1:

Copy the python34.dll file to c:\windows\system32 and name the copy python33.dll

The create language plpython3u should then work without a problem.

Solution 2:

Exactly the same situation I faced with Postgres 9.6 Windows 10. PL/Python3U would not get through.

Worked around it:

Installed Python34 64bit Windows 10 version. Copied Python34.dll to c:\windows\system32 as Python33.dll and it worked.

Solution 3:

The information is in Makefile of source installation package

We need libpython as a shared library. In Python >=2.5, configure asks Python directly. But because this has been broken in Debian for a long time (http://bugs.debian.org/695979), and to support older Python versions, we see if there is a file that is named like a shared library as a fallback.

for python windows:

ifeq ($(PORTNAME), win32)

    pytverstr=$(subst .,,${python_version})
    PYTHONDLL=$(subst \,/,$(WINDIR))/system32/python${pytverstr}.dll

So the write answer is:

  • WINDIR is : C:\Windows
  • pytverstr is use in makefile has a parameter to define version of python
  • PYTHONDLL is the location of dll

To check version of my installation, I open plpython3.dll located in C:\Program Files\PostgreSQL\9.4\lib (change path with your environnement)

With Notepad++ and search PyUnicode_AsUTF8String the python dll version is visible in last word (in my case python33.dll)

check your installation to choice the good installer of python

SELECT version();

PostgreSQL 9.4.15, compiled by Visual C++ build 1800, 64-bit

So I need install Python 33 in 64bit

edit 2020-10-02

There is also all of these informations in doc of binary ..pgsql\doc\installation-notes.html look at title Procedural Languages

edit 2021-06-11

After install the good version of Python on your system you need copy it to C:\Windows\System32

Replacing the version of python with an old name is not a good solution because you can have librairie it not work with this version. Do that if you know risks. So if you want a newest version of python for plpython, compile it or check edb compilation to check if it contains what you need. You can ask EDB for this information.

Solution 4:

plpython3.dll in the official package is built against python 3.3, not python 3.4. What it expect is python33.dll in system32 folder. You need to install python 3.3 for your system.

Since py33 has been phased out, you may soon get frustrated, due to lack of pre-built binary package, lxml, pyzmq etc all needs to be built from source. If you need any binary module, make sure you have a correctly set up compiler.

Solution 5:

This may be helpful, I have struggled a lot with this. For me only worked when I installed the right version of python and added paths to environment variables. I am not sure if python 3.4.0 would be the right version for PostgreSQL Server 9.6.0 but it worked fine with PostgreSQL Server 10.0.

Try version python-3.4.0.amd64 for windows 64bit or other versions from this Python 3.4.0 downloads Link

Environment variables to add:

C:\Python34\Scripts C:\Python34\

Post a Comment for "Error During: Create Extension Plpython3u; On Postgresql 9.6.0"