Thread: Error CREATE EXTENSION plpythonu

Error CREATE EXTENSION plpythonu

From
milad moradi
Date:
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.png


Attachment

Re: Error CREATE EXTENSION plpythonu

From
Fahar Abbas
Date:
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.moradi89@gmail.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.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
Attachment

Re: Error CREATE EXTENSION plpythonu

From
Fahar Abbas
Date:
Please note that your path should be on same terminal(command prompt) where you will do pg_ctl.

On Fri, Jul 26, 2019 at 7:16 PM Fahar Abbas <fahar.abbas@enterprisedb.com> wrote:
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.moradi89@gmail.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.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


--
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
Attachment