Thread: Error CREATE EXTENSION plpythonu

Attachment
- Install PostgreSQL and install latest language pack installer with default options
- open terminal with su - postgres and perform following operation using same terminal
- go into bin folder
- ./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)
- ./pg_ctl -D /opt/PostgreSQL/9.4/data start -o "-p 5432"
- open psql
create language plpython3u;
CREATE LANGUAGE plpython3u;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);
Hello,I am using PostgreSQL : PostgreSQL 11.4, compiled by Visual C++ build 1914, 64-biton 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 ??
--
Phone Direct: +92-51-8466803
Mobile: +92-333-5409707
Skype ID: live:fahar.abbas
Website: www.enterprisedb.com
Attachment
Hi,No this is not an issue and you need to install language pack 11 through StackBuilder.Here is the example
- Install PostgreSQL and install latest language pack installer with default options
- open terminal with su - postgres and perform following operation using same terminal
- go into bin folder
- ./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.3For 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
variablesFor 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.3For 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)
- ./pg_ctl -D /opt/PostgreSQL/9.4/data start -o "-p 5432"
- open psql
create language plpython3u;
CREATE LANGUAGE plpython3u;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-biton 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 ??
--Fahar AbbasQMGEnterpriseDB CorporationPhone Office: +92-51-835-8874
Phone Direct: +92-51-8466803
Mobile: +92-333-5409707
Skype ID: live:fahar.abbas
Website: www.enterprisedb.com
--
Phone Direct: +92-51-8466803
Mobile: +92-333-5409707
Skype ID: live:fahar.abbas
Website: www.enterprisedb.com