Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any recipe to successfully install PLPython in Postgresql 9.3 64bit or 32bit on Windows 64 bits?

running CREATE EXTENSION plpython3u gave me the error - The specified module could not be found even if the file is at the correct place.

After reading everything on the web, I tried to download another python version (3.2) as suggested and replace the dll.

Now I receive an error about a missing magic block: missing magic block HINT: Extension libraries are required to use the PG_MODULE_MAGIC macro.

I tried the same processes with a 32 and 64 bits version of Postgresql and both failed like explained.

Is there any solution to install that PLPython on a Windows 64 bits OS?

like image 324
Etienne Desgagné Avatar asked Jan 24 '14 02:01

Etienne Desgagné


People also ask

How to install Python on PostgreSQL 64 bit?

Make sure Python is added to the PATH by the installer (it's an option when you run the installer). Then re-try after re-starting PostgreSQL. where python-2.7.3.amd64.msi is the filename of the Python binary you installed, and you're installing the 64-bit version to C:\Python27_x64.

How do I use PL Python in PostgreSQL?

Environment Variables The PL/Python procedural language allows PostgreSQL functions and procedures to be written in the Python language. To install PL/Python in a particular database, use CREATE EXTENSION plpythonu (but see also Section 46.1 ).

Why can't I run plpython on PostgreSQL?

If you have plpython2.dll but it won't load, you need to install the Python runtime that matches the PostgreSQL version. It must be the same Python major version as was used to compile PostgreSQL, e.g. if Python 2.7 was used to compile PostgreSQL, Python 2.6 won't work to run plpython.

Why do I need to install the plpython3u package on Ubuntu?

You need to install the package if you have any PostgreSQL 11 functions that use the languages plpython or plpythonu. PostgreSQL is an object-relational SQL database management system. $ sudo apt-cache search ".*plpython3.*" Created the plpython3u extension and verify it.


1 Answers

Worked for me (Windows 7 64-bit)

I installed Python 3.2 from here:

http://www.python.org/ftp/python/3.2/python-3.2.amd64.msi

Somebody screwed something up, so you need to do the following:

  1. find python3.dll in C:\Python32\DLLs (or wherever you installed it)

  2. copy python3.dll to python32.dll (like copy and paste it then rename it)

  3. run create extension plpython3u in postgres

like image 180
Neil McGuigan Avatar answered Oct 05 '22 21:10

Neil McGuigan