Re: Error CREATE EXTENSION plpythonu

From: Fahar Abbas <fahar(dot)abbas(at)enterprisedb(dot)com>
To: milad moradi <milad(dot)moradi89(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Error CREATE EXTENSION plpythonu
Date: 2019-07-26 14:16:39
Message-ID: CAJFwRrN9eQyX=gtH0T98WsXR+5qQY_hwUU+y-c2YpEQzi1bkCQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

No this is not an issue and you need to install language pack 11 through
StackBuilder.

Here is the example

1. Install PostgreSQL and install latest language pack installer with
default options
2. open terminal with su - postgres and perform following operation
using same terminal
3. go into bin folder
4. ./pg_ctl -D /opt/PostgreSQL/9.4/data stop -o "-p 5432"

For Linux:

export
LD_LIBRARY_PATH=/opt/edb/languagepack-9.6/Python-3.3/lib/:$LD_LIBRARY_PATH
export PATH=/opt/edb/languagepack-9.6/Python-3.3/bin/:$PATH
export PYTHONHOME=/opt/edb/languagepack-9.6/Python-3.3
export PYTHONPATH=/opt/edb/languagepack-9.6/Python-3.3
For MAC:

export
LD_LIBRARY_PATH=/Library/edb/languagepack-9.6/Python-3.3/lib/:$LD_LIBRARY_PATH
export PATH=/Library/edb/languagepack-9.6/Python-3.3/bin/:$PATH
export PYTHONHOME=/Library/edb/languagepack-9.6/Python-3.3
export PYTHONPATH=/Library/edb/languagepack-9.6/Python-3.3
(Set environment variable on windows:

Right click on My computer->properties->Advanced System
Settings->Advanced tab->Environment Variables button->System
variables
For Windows 32:

C:\edb\languagepack-9.6\i386\Python-3.3;C:\edb\languagepack-9.6\i386\Perl-5.20\bin;C:\edb\languagepack-9.6\i386\Tcl-8.5\bin;
PYTHONHOME=C:\edb\languagepack-9.6\i386\Python-3.3
For Windows 64:

C:\edb\languagepack-9.6\x64\Python-3.3;C:\edb\languagepack-9.6\x64\Perl-5.20\bin;C:\edb\languagepack-9.6\x64\Tcl-8.5\bin;
PYTHONHOME=C:\edb\languagepack-9.6\x64\Python-3.3
Restart windows VM)

1. ./pg_ctl -D /opt/PostgreSQL/9.4/data start -o "-p 5432"
2. open psql
3.

create language plpython3u;
CREATE LANGUAGE plpython3u;
4.

Check functionality

CREATE FUNCTION pymax (a integer, b integer) RETURNS integer AS $$ if a >
b: return a return b $$ LANGUAGE plpython3u;

You can call the function (pymax), passing two values:

SELECT pymax(1, 2);

On Fri, Jul 26, 2019 at 7:09 PM milad moradi <milad(dot)moradi89(at)gmail(dot)com>
wrote:

> Hello,
> I am using PostgreSQL : PostgreSQL 11.4, compiled by Visual C++ build
> 1914, 64-bit
>
> on windows 10.
>
> I tried to use python for programming but I receieved an error:
>
> create extension plpython3u:
>
> ERROR: ERREUR: n'a pas pu charger la bibliothèque « C:/Program
> Files/PostgreSQL/11/lib/plpython3.dll » : The specified module could not be
> found.
> it is in French and says that the library cannot be loaded but the library
> exists in my system and also the latest version of python is installed.
> I saw many people received the same error message in the internet. It is a
> bug ??
>
>
>
>
>
>
> [image: image.png]
>
>
>

--
Fahar Abbas
QMG
EnterpriseDB Corporation
Phone Office: +92-51-835-8874
Phone Direct: +92-51-8466803
Mobile: +92-333-5409707
Skype ID: *live:fahar.abbas*
Website: www.enterprisedb.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Fahar Abbas 2019-07-26 14:20:15 Re: Error CREATE EXTENSION plpythonu
Previous Message milad moradi 2019-07-26 13:55:17 Error CREATE EXTENSION plpythonu