pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Help with plpython3u
21+ messages / 3 participants
[nested] [flat]

* Help with plpython3u
@ 2020-06-10 00:09 PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:17 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 21+ messages in thread

From: PEDRO PABLO SEVERIN HONORATO @ 2020-06-10 00:09 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Hello!

I'm cracking my head while trying to make python language work within
postges. I executed "*create extension plpython3u*" but I get this error:

"*ERROR: could not load library "C:/Program
Files/PostgreSQL/12/lib/plpython3.dll": The specified module could not be
found. SQL state: 58P01*"

Looking into several stackoverflow pages and asking like everywhere, I also
installed dependency walker and saw that python37.dll was required. My PC
already has python 3.7.4, but I don't know if that is an issue and postgres
requires python 3.7.0 strictly.

I also copied the python37.dll file directly in the System32 folder, as
some pages suggested. That actually made it possible to run the "* create
extension plpython3u* ", but when I try to create a simple function like:

"*CREATE FUNCTION pymax (a integer, b integer)*





*  RETURNS integerAS $$  if a > b:    return a  return b*
*$$ LANGUAGE plpython3u*;"

The server crashes and I get this message: "*Connection to the server has
been lost*."

Some additional information:
- My PC is running windows server 2019 64 bits (its a vps)
- The python version I have is 3.7.4. Installed it with Anaconda
- Postgres version is 12.2-1. pgAdmin is 4.18

Please, help me :(
Regards,
PS

^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Help with plpython3u
  2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
@ 2020-06-10 00:17 ` Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 00:26   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  0 siblings, 1 reply; 21+ messages in thread

From: Adrian Klaver @ 2020-06-10 00:17 UTC (permalink / raw)
  To: PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>; pgsql-general@lists.postgresql.org

On 6/9/20 5:09 PM, PEDRO PABLO SEVERIN HONORATO wrote:
> Hello!
> 
> I'm cracking my head while trying to make python language work within 
> postges. I executed "*create extension plpython3u*" but I get this error:
> 
> "*ERROR: could not load library "C:/Program 
> Files/PostgreSQL/12/lib/plpython3.dll": The specified module could not 
> be found. SQL state: 58P01*"
> 
> Looking into several stackoverflow pages and asking like everywhere, I 
> also installed dependency walker and saw that python37.dll was required. 
> My PC already has python 3.7.4, but I don't know if that is an issue and 
> postgres requires python 3.7.0 strictly.
> 
> I also copied the python37.dll file directly in the System32 folder, as 
> some pages suggested. That actually made it possible to run the 
> "* create extension plpython3u* ", but when I try to create a simple 
> function like:
> 
> "*CREATE FUNCTION pymax (a integer, b integer)*
> *  RETURNS integer
> AS $$
>    if a > b:
>      return a
>    return b
> *
> *$$ LANGUAGE plpython3u*;"
> 
> The server crashes and I get this message: "*Connection to the server 
> has been lost*."
> 
> Some additional information:
> - My PC is running windows server 2019 64 bits (its a vps)

How did you install Postgres?

> - The python version I have is 3.7.4. Installed it with Anaconda

Unless things have changed since the last time I used Anaconda, it 
basically creates virtualenvs for it's installs. So when you refer to 
the Python dll above are you talking about a system installed one or one 
from within the Anaconda environment?

> - Postgres version is 12.2-1. pgAdmin is 4.18
> 
> Please, help me :(
> Regards,
> PS


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Help with plpython3u
  2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:17 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
@ 2020-06-10 00:26   ` PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:37     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 06:49     ` Re: Help with plpython3u Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 2 replies; 21+ messages in thread

From: PEDRO PABLO SEVERIN HONORATO @ 2020-06-10 00:26 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general@lists.postgresql.org

Hi Adrian,

I installed Postgres downloading the file posgresql-12.2-1-windows-x64 from
the website https://www.postgresql.org/download/windows/.

The python37.dll I copied to the System32 folder was located
in C:\Users\developer\Anaconda3.
After trying this, I installed python 3.7.0 and copied the python37.dll
that comes with the installation, but got the same result.

Thanks,
PS

El mar., 9 jun. 2020 a las 20:17, Adrian Klaver (<adrian.klaver@aklaver.com>)
escribió:

> On 6/9/20 5:09 PM, PEDRO PABLO SEVERIN HONORATO wrote:
> > Hello!
> >
> > I'm cracking my head while trying to make python language work within
> > postges. I executed "*create extension plpython3u*" but I get this error:
> >
> > "*ERROR: could not load library "C:/Program
> > Files/PostgreSQL/12/lib/plpython3.dll": The specified module could not
> > be found. SQL state: 58P01*"
> >
> > Looking into several stackoverflow pages and asking like everywhere, I
> > also installed dependency walker and saw that python37.dll was required.
> > My PC already has python 3.7.4, but I don't know if that is an issue and
> > postgres requires python 3.7.0 strictly.
> >
> > I also copied the python37.dll file directly in the System32 folder, as
> > some pages suggested. That actually made it possible to run the
> > "* create extension plpython3u* ", but when I try to create a simple
> > function like:
> >
> > "*CREATE FUNCTION pymax (a integer, b integer)*
> > *  RETURNS integer
> > AS $$
> >    if a > b:
> >      return a
> >    return b
> > *
> > *$$ LANGUAGE plpython3u*;"
> >
> > The server crashes and I get this message: "*Connection to the server
> > has been lost*."
> >
> > Some additional information:
> > - My PC is running windows server 2019 64 bits (its a vps)
>
> How did you install Postgres?
>
> > - The python version I have is 3.7.4. Installed it with Anaconda
>
> Unless things have changed since the last time I used Anaconda, it
> basically creates virtualenvs for it's installs. So when you refer to
> the Python dll above are you talking about a system installed one or one
> from within the Anaconda environment?
>
> > - Postgres version is 12.2-1. pgAdmin is 4.18
> >
> > Please, help me :(
> > Regards,
> > PS
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>

^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Help with plpython3u
  2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:17 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 00:26   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
@ 2020-06-10 00:37     ` Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 01:17       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  1 sibling, 1 reply; 21+ messages in thread

From: Adrian Klaver @ 2020-06-10 00:37 UTC (permalink / raw)
  To: PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>; +Cc: pgsql-general@lists.postgresql.org

On 6/9/20 5:26 PM, PEDRO PABLO SEVERIN HONORATO wrote:
> Hi Adrian,
> 
> I installed Postgres downloading the file posgresql-12.2-1-windows-x64 
> from the website https://www.postgresql.org/download/windows/.

Did you go through the steps here?:

https://www.enterprisedb.com/edb-docs/d/postgresql/user-guides/language-pack-guide/12/toc.html

> 
> The python37.dll I copied to the System32 folder was located 
> in C:\Users\developer\Anaconda3.
> After trying this, I installed python 3.7.0 and copied the python37.dll 
> that comes with the installation, but got the same result.
> 
> Thanks,
> PS
> 
> El mar., 9 jun. 2020 a las 20:17, Adrian Klaver 
> (<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>>) escribió:
> 
>     On 6/9/20 5:09 PM, PEDRO PABLO SEVERIN HONORATO wrote:
>      > Hello!
>      >
>      > I'm cracking my head while trying to make python language work
>     within
>      > postges. I executed "*create extension plpython3u*" but I get
>     this error:
>      >
>      > "*ERROR: could not load library "C:/Program
>      > Files/PostgreSQL/12/lib/plpython3.dll": The specified module
>     could not
>      > be found. SQL state: 58P01*"
>      >
>      > Looking into several stackoverflow pages and asking like
>     everywhere, I
>      > also installed dependency walker and saw that python37.dll was
>     required.
>      > My PC already has python 3.7.4, but I don't know if that is an
>     issue and
>      > postgres requires python 3.7.0 strictly.
>      >
>      > I also copied the python37.dll file directly in the System32
>     folder, as
>      > some pages suggested. That actually made it possible to run the
>      > "* create extension plpython3u* ", but when I try to create a simple
>      > function like:
>      >
>      > "*CREATE FUNCTION pymax (a integer, b integer)*
>      > *  RETURNS integer
>      > AS $$
>      >    if a > b:
>      >      return a
>      >    return b
>      > *
>      > *$$ LANGUAGE plpython3u*;"
>      >
>      > The server crashes and I get this message: "*Connection to the
>     server
>      > has been lost*."
>      >
>      > Some additional information:
>      > - My PC is running windows server 2019 64 bits (its a vps)
> 
>     How did you install Postgres?
> 
>      > - The python version I have is 3.7.4. Installed it with Anaconda
> 
>     Unless things have changed since the last time I used Anaconda, it
>     basically creates virtualenvs for it's installs. So when you refer to
>     the Python dll above are you talking about a system installed one or
>     one
>     from within the Anaconda environment?
> 
>      > - Postgres version is 12.2-1. pgAdmin is 4.18
>      >
>      > Please, help me :(
>      > Regards,
>      > PS
> 
> 
>     -- 
>     Adrian Klaver
>     adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Help with plpython3u
  2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:17 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 00:26   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:37     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
@ 2020-06-10 01:17       ` PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 02:16         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 21+ messages in thread

From: PEDRO PABLO SEVERIN HONORATO @ 2020-06-10 01:17 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general@lists.postgresql.org

Thanks Adrian, this actually helped me. I was looking for the "language
pack" thing without any success and thanks god that you pointed me in the
right direction :)

What I don't understand is the following. After installing the language
pack with stack builder, added a variable named "PYTHONHOME" with its path (
C:\edb\languagepack\v1\Python-3.7) and then added PYTHONHOME and the full
path to the PATH variable. After that, I restarted the server as requested
but nothing happened. Then I added "%" to the beginning and the end of
PYTHONHOME and C:\edb\languagepack\v1\Python-3.7, restarted the server and
then it worked. Why is that?

Also, I would like to know if it is possible to import specific python
libraries? For example, I would like to use the talib library, which can be
downloaded and installed. Or a custom library made by myself. And how can I
import other python libraries, like scikit learn? Where can I find
information about this?

Thank you so much for your help!! :D
PS

El mar., 9 jun. 2020 a las 20:37, Adrian Klaver (<adrian.klaver@aklaver.com>)
escribió:

> On 6/9/20 5:26 PM, PEDRO PABLO SEVERIN HONORATO wrote:
> > Hi Adrian,
> >
> > I installed Postgres downloading the file posgresql-12.2-1-windows-x64
> > from the website https://www.postgresql.org/download/windows/.
>
> Did you go through the steps here?:
>
>
> https://www.enterprisedb.com/edb-docs/d/postgresql/user-guides/language-pack-guide/12/toc.html
>
> >
> > The python37.dll I copied to the System32 folder was located
> > in C:\Users\developer\Anaconda3.
> > After trying this, I installed python 3.7.0 and copied the python37.dll
> > that comes with the installation, but got the same result.
> >
> > Thanks,
> > PS
> >
> > El mar., 9 jun. 2020 a las 20:17, Adrian Klaver
> > (<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>>)
> escribió:
> >
> >     On 6/9/20 5:09 PM, PEDRO PABLO SEVERIN HONORATO wrote:
> >      > Hello!
> >      >
> >      > I'm cracking my head while trying to make python language work
> >     within
> >      > postges. I executed "*create extension plpython3u*" but I get
> >     this error:
> >      >
> >      > "*ERROR: could not load library "C:/Program
> >      > Files/PostgreSQL/12/lib/plpython3.dll": The specified module
> >     could not
> >      > be found. SQL state: 58P01*"
> >      >
> >      > Looking into several stackoverflow pages and asking like
> >     everywhere, I
> >      > also installed dependency walker and saw that python37.dll was
> >     required.
> >      > My PC already has python 3.7.4, but I don't know if that is an
> >     issue and
> >      > postgres requires python 3.7.0 strictly.
> >      >
> >      > I also copied the python37.dll file directly in the System32
> >     folder, as
> >      > some pages suggested. That actually made it possible to run the
> >      > "* create extension plpython3u* ", but when I try to create a
> simple
> >      > function like:
> >      >
> >      > "*CREATE FUNCTION pymax (a integer, b integer)*
> >      > *  RETURNS integer
> >      > AS $$
> >      >    if a > b:
> >      >      return a
> >      >    return b
> >      > *
> >      > *$$ LANGUAGE plpython3u*;"
> >      >
> >      > The server crashes and I get this message: "*Connection to the
> >     server
> >      > has been lost*."
> >      >
> >      > Some additional information:
> >      > - My PC is running windows server 2019 64 bits (its a vps)
> >
> >     How did you install Postgres?
> >
> >      > - The python version I have is 3.7.4. Installed it with Anaconda
> >
> >     Unless things have changed since the last time I used Anaconda, it
> >     basically creates virtualenvs for it's installs. So when you refer to
> >     the Python dll above are you talking about a system installed one or
> >     one
> >     from within the Anaconda environment?
> >
> >      > - Postgres version is 12.2-1. pgAdmin is 4.18
> >      >
> >      > Please, help me :(
> >      > Regards,
> >      > PS
> >
> >
> >     --
> >     Adrian Klaver
> >     adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
> >
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>

^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Help with plpython3u
  2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:17 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 00:26   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:37     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 01:17       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
@ 2020-06-10 02:16         ` Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 05:38           ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  0 siblings, 1 reply; 21+ messages in thread

From: Adrian Klaver @ 2020-06-10 02:16 UTC (permalink / raw)
  To: PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>; +Cc: pgsql-general@lists.postgresql.org

On 6/9/20 6:17 PM, PEDRO PABLO SEVERIN HONORATO wrote:
> Thanks Adrian, this actually helped me. I was looking for the "language 
> pack" thing without any success and thanks god that you pointed me in 
> the right direction :)
> 
> What I don't understand is the following. After installing the language 
> pack with stack builder, added a variable named "PYTHONHOME" with its 
> path (C:\edb\languagepack\v1\Python-3.7) and then added PYTHONHOME and 
> the full path to the PATH variable. After that, I restarted the server 
> as requested but nothing happened. Then I added "%" to the beginning and 
> the end of PYTHONHOME and C:\edb\languagepack\v1\Python-3.7, restarted 
> the server and then it worked. Why is that?

For explanation see here:

https://docs.python.org/3.7/using/windows.html
3.6.1. Excursus: Setting environment variables

> 
> Also, I would like to know if it is possible to import specific python 
> libraries? For example, I would like to use the talib library, which can 
> be downloaded and installed. Or a custom library made by myself. And how 
> can I import other python libraries, like scikit learn? Where can I find 
> information about this?

Yes you can import libraries/packages. The issue is where you are 
installing them, in the system or the Anaconda environment. I don't work 
with Windows much anymore, so I am not up on how to grab a library from 
within an Anaconda environment. Maybe someone else can help or you might 
ask the Anaconda forum:

https://groups.google.com/a/anaconda.com/forum/#!forum/anaconda

> 
> Thank you so much for your help!! :D
> PS
> 
> El mar., 9 jun. 2020 a las 20:37, Adrian Klaver 
> (<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>>) escribió:
> 
>     On 6/9/20 5:26 PM, PEDRO PABLO SEVERIN HONORATO wrote:
>      > Hi Adrian,
>      >
>      > I installed Postgres downloading the file
>     posgresql-12.2-1-windows-x64
>      > from the website https://www.postgresql.org/download/windows/.
> 
>     Did you go through the steps here?:
> 
>     https://www.enterprisedb.com/edb-docs/d/postgresql/user-guides/language-pack-guide/12/toc.html
> 
>      >
>      > The python37.dll I copied to the System32 folder was located
>      > in C:\Users\developer\Anaconda3.
>      > After trying this, I installed python 3.7.0 and copied the
>     python37.dll
>      > that comes with the installation, but got the same result.
>      >
>      > Thanks,
>      > PS
>      >
>      > El mar., 9 jun. 2020 a las 20:17, Adrian Klaver
>      > (<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
>     <mailto:adrian.klaver@aklaver.com
>     <mailto:adrian.klaver@aklaver.com>>>) escribió:
>      >
>      >     On 6/9/20 5:09 PM, PEDRO PABLO SEVERIN HONORATO wrote:
>      >      > Hello!
>      >      >
>      >      > I'm cracking my head while trying to make python language work
>      >     within
>      >      > postges. I executed "*create extension plpython3u*" but I get
>      >     this error:
>      >      >
>      >      > "*ERROR: could not load library "C:/Program
>      >      > Files/PostgreSQL/12/lib/plpython3.dll": The specified module
>      >     could not
>      >      > be found. SQL state: 58P01*"
>      >      >
>      >      > Looking into several stackoverflow pages and asking like
>      >     everywhere, I
>      >      > also installed dependency walker and saw that python37.dll was
>      >     required.
>      >      > My PC already has python 3.7.4, but I don't know if that is an
>      >     issue and
>      >      > postgres requires python 3.7.0 strictly.
>      >      >
>      >      > I also copied the python37.dll file directly in the System32
>      >     folder, as
>      >      > some pages suggested. That actually made it possible to
>     run the
>      >      > "* create extension plpython3u* ", but when I try to
>     create a simple
>      >      > function like:
>      >      >
>      >      > "*CREATE FUNCTION pymax (a integer, b integer)*
>      >      > *  RETURNS integer
>      >      > AS $$
>      >      >    if a > b:
>      >      >      return a
>      >      >    return b
>      >      > *
>      >      > *$$ LANGUAGE plpython3u*;"
>      >      >
>      >      > The server crashes and I get this message: "*Connection to the
>      >     server
>      >      > has been lost*."
>      >      >
>      >      > Some additional information:
>      >      > - My PC is running windows server 2019 64 bits (its a vps)
>      >
>      >     How did you install Postgres?
>      >
>      >      > - The python version I have is 3.7.4. Installed it with
>     Anaconda
>      >
>      >     Unless things have changed since the last time I used
>     Anaconda, it
>      >     basically creates virtualenvs for it's installs. So when you
>     refer to
>      >     the Python dll above are you talking about a system installed
>     one or
>      >     one
>      >     from within the Anaconda environment?
>      >
>      >      > - Postgres version is 12.2-1. pgAdmin is 4.18
>      >      >
>      >      > Please, help me :(
>      >      > Regards,
>      >      > PS
>      >
>      >
>      >     --
>      >     Adrian Klaver
>      > adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
>     <mailto:adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>>
>      >
> 
> 
>     -- 
>     Adrian Klaver
>     adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Help with plpython3u
  2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:17 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 00:26   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:37     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 01:17       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 02:16         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
@ 2020-06-10 05:38           ` PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:08             ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 21+ messages in thread

From: PEDRO PABLO SEVERIN HONORATO @ 2020-06-10 05:38 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general@lists.postgresql.org

Thank you, Adrian. Will read about all this. By the way, the issue
reappeared. For some reason, I had to reinstall Anaconda and had to delete
the "PYTHONHOME" variable because I could not launch conda.
Seems that they both fight for the same variable name?
Is there a way to set it to two different names?

Thanks,
PS


El mar., 9 jun. 2020 a las 22:16, Adrian Klaver (<adrian.klaver@aklaver.com>)
escribió:

> On 6/9/20 6:17 PM, PEDRO PABLO SEVERIN HONORATO wrote:
> > Thanks Adrian, this actually helped me. I was looking for the "language
> > pack" thing without any success and thanks god that you pointed me in
> > the right direction :)
> >
> > What I don't understand is the following. After installing the language
> > pack with stack builder, added a variable named "PYTHONHOME" with its
> > path (C:\edb\languagepack\v1\Python-3.7) and then added PYTHONHOME and
> > the full path to the PATH variable. After that, I restarted the server
> > as requested but nothing happened. Then I added "%" to the beginning and
> > the end of PYTHONHOME and C:\edb\languagepack\v1\Python-3.7, restarted
> > the server and then it worked. Why is that?
>
> For explanation see here:
>
> https://docs.python.org/3.7/using/windows.html
> 3.6.1. Excursus: Setting environment variables
>
> >
> > Also, I would like to know if it is possible to import specific python
> > libraries? For example, I would like to use the talib library, which can
> > be downloaded and installed. Or a custom library made by myself. And how
> > can I import other python libraries, like scikit learn? Where can I find
> > information about this?
>
> Yes you can import libraries/packages. The issue is where you are
> installing them, in the system or the Anaconda environment. I don't work
> with Windows much anymore, so I am not up on how to grab a library from
> within an Anaconda environment. Maybe someone else can help or you might
> ask the Anaconda forum:
>
> https://groups.google.com/a/anaconda.com/forum/#!forum/anaconda
>
> >
> > Thank you so much for your help!! :D
> > PS
> >
> > El mar., 9 jun. 2020 a las 20:37, Adrian Klaver
> > (<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>>)
> escribió:
> >
> >     On 6/9/20 5:26 PM, PEDRO PABLO SEVERIN HONORATO wrote:
> >      > Hi Adrian,
> >      >
> >      > I installed Postgres downloading the file
> >     posgresql-12.2-1-windows-x64
> >      > from the website https://www.postgresql.org/download/windows/.
> >
> >     Did you go through the steps here?:
> >
> >
> https://www.enterprisedb.com/edb-docs/d/postgresql/user-guides/language-pack-guide/12/toc.html
> >
> >      >
> >      > The python37.dll I copied to the System32 folder was located
> >      > in C:\Users\developer\Anaconda3.
> >      > After trying this, I installed python 3.7.0 and copied the
> >     python37.dll
> >      > that comes with the installation, but got the same result.
> >      >
> >      > Thanks,
> >      > PS
> >      >
> >      > El mar., 9 jun. 2020 a las 20:17, Adrian Klaver
> >      > (<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
> >     <mailto:adrian.klaver@aklaver.com
> >     <mailto:adrian.klaver@aklaver.com>>>) escribió:
> >      >
> >      >     On 6/9/20 5:09 PM, PEDRO PABLO SEVERIN HONORATO wrote:
> >      >      > Hello!
> >      >      >
> >      >      > I'm cracking my head while trying to make python language
> work
> >      >     within
> >      >      > postges. I executed "*create extension plpython3u*" but I
> get
> >      >     this error:
> >      >      >
> >      >      > "*ERROR: could not load library "C:/Program
> >      >      > Files/PostgreSQL/12/lib/plpython3.dll": The specified
> module
> >      >     could not
> >      >      > be found. SQL state: 58P01*"
> >      >      >
> >      >      > Looking into several stackoverflow pages and asking like
> >      >     everywhere, I
> >      >      > also installed dependency walker and saw that python37.dll
> was
> >      >     required.
> >      >      > My PC already has python 3.7.4, but I don't know if that
> is an
> >      >     issue and
> >      >      > postgres requires python 3.7.0 strictly.
> >      >      >
> >      >      > I also copied the python37.dll file directly in the
> System32
> >      >     folder, as
> >      >      > some pages suggested. That actually made it possible to
> >     run the
> >      >      > "* create extension plpython3u* ", but when I try to
> >     create a simple
> >      >      > function like:
> >      >      >
> >      >      > "*CREATE FUNCTION pymax (a integer, b integer)*
> >      >      > *  RETURNS integer
> >      >      > AS $$
> >      >      >    if a > b:
> >      >      >      return a
> >      >      >    return b
> >      >      > *
> >      >      > *$$ LANGUAGE plpython3u*;"
> >      >      >
> >      >      > The server crashes and I get this message: "*Connection to
> the
> >      >     server
> >      >      > has been lost*."
> >      >      >
> >      >      > Some additional information:
> >      >      > - My PC is running windows server 2019 64 bits (its a vps)
> >      >
> >      >     How did you install Postgres?
> >      >
> >      >      > - The python version I have is 3.7.4. Installed it with
> >     Anaconda
> >      >
> >      >     Unless things have changed since the last time I used
> >     Anaconda, it
> >      >     basically creates virtualenvs for it's installs. So when you
> >     refer to
> >      >     the Python dll above are you talking about a system installed
> >     one or
> >      >     one
> >      >     from within the Anaconda environment?
> >      >
> >      >      > - Postgres version is 12.2-1. pgAdmin is 4.18
> >      >      >
> >      >      > Please, help me :(
> >      >      > Regards,
> >      >      > PS
> >      >
> >      >
> >      >     --
> >      >     Adrian Klaver
> >      > adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
> >     <mailto:adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com
> >>
> >      >
> >
> >
> >     --
> >     Adrian Klaver
> >     adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
> >
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>

^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Help with plpython3u
  2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:17 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 00:26   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:37     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 01:17       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 02:16         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 05:38           ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
@ 2020-06-10 14:08             ` Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 14:39               ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  0 siblings, 1 reply; 21+ messages in thread

From: Adrian Klaver @ 2020-06-10 14:08 UTC (permalink / raw)
  To: PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>; +Cc: pgsql-general@lists.postgresql.org

On 6/9/20 10:38 PM, PEDRO PABLO SEVERIN HONORATO wrote:
> Thank you, Adrian. Will read about all this. By the way, the issue 
> reappeared. For some reason, I had to reinstall Anaconda and had to 
> delete the "PYTHONHOME" variable because I could not launch conda.
> Seems that they both fight for the same variable name?
> Is there a way to set it to two different names?

See below for more information:

https://docs.anaconda.com/anaconda/user-guide/faq/#installing-anaconda
> 
> Thanks,
> PS
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Help with plpython3u
  2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:17 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 00:26   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:37     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 01:17       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 02:16         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 05:38           ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:08             ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
@ 2020-06-10 14:39               ` PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:50                 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 21+ messages in thread

From: PEDRO PABLO SEVERIN HONORATO @ 2020-06-10 14:39 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general@lists.postgresql.org

Thank you Adrian, will see the link you sent me.

Thank you, Laurenz. I noticed that copying the DLL is not a good idea.
How can I set a python path for postgres, so that I tell postgres "hey, if
you are looking for python see this path" and don't lose conda? Because
after following all Adrian's instructions and  after creating the
variable"*PYTHONHOME
= C:\edb\languagepack\v1\Python-3.7*" and adding *%PYTHONHOME%* to the *PATH,
*I get this message when I open Anaconda Prompt:
*"File "C:\Users\developer\Anaconda3\Scripts\conda-script.py", line 11, in
<module> from conda.cli import main ModuleNotFoundError: No module named
'conda'"*

Then, I removed the variable name PYTHONHOME and tried to execute again
Anaconda Prompt without any problem. So I think that postgres and conda are
like "fighting" for the PYTHONHOME variable name? Is this correct?

El mié., 10 jun. 2020 a las 10:08, Adrian Klaver (<adrian.klaver@aklaver.com>)
escribió:

> On 6/9/20 10:38 PM, PEDRO PABLO SEVERIN HONORATO wrote:
> > Thank you, Adrian. Will read about all this. By the way, the issue
> > reappeared. For some reason, I had to reinstall Anaconda and had to
> > delete the "PYTHONHOME" variable because I could not launch conda.
> > Seems that they both fight for the same variable name?
> > Is there a way to set it to two different names?
>
> See below for more information:
>
> https://docs.anaconda.com/anaconda/user-guide/faq/#installing-anaconda
> >
> > Thanks,
> > PS
> >
> >
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>

^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Help with plpython3u
  2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:17 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 00:26   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:37     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 01:17       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 02:16         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 05:38           ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:08             ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 14:39               ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
@ 2020-06-10 14:50                 ` Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 15:25                   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  0 siblings, 1 reply; 21+ messages in thread

From: Adrian Klaver @ 2020-06-10 14:50 UTC (permalink / raw)
  To: PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>; +Cc: pgsql-general@lists.postgresql.org

On 6/10/20 7:39 AM, PEDRO PABLO SEVERIN HONORATO wrote:
> Thank you Adrian, will see the link you sent me.
> 
> Thank you, Laurenz. I noticed that copying the DLL is not a good idea.
> How can I set a python path for postgres, so that I tell postgres "hey, 
> if you are looking for python see this path" and don't lose conda? 
> Because after following all Adrian's instructions and  after creating 
> the variable"*PYTHONHOME = C:\edb\languagepack\v1\Python-3.7*" and 

Just to be clear those where instructions from here, correct?:

https://www.enterprisedb.com/edb-docs/d/edb-postgres-advanced-server/user-guides/language-pack-guide...

> adding *%PYTHONHOME%* to the *PATH, *I get this message when I open 
> Anaconda Prompt:
> *"File "C:\Users\developer\Anaconda3\Scripts\conda-script.py", line 11, 
> in <module> from conda.cli import main ModuleNotFoundError: No module 
> named 'conda'"*

So when you did the Anaconda install:

https://docs.anaconda.com/anaconda/install/windows/

What did you check for the Advanced options in Step 8?

> *
> *
> Then, I removed the variable name PYTHONHOME and tried to execute again 
> Anaconda Prompt without any problem. So I think that postgres and conda 
> are like "fighting" for the PYTHONHOME variable name? Is this correct?
> 
> El mié., 10 jun. 2020 a las 10:08, Adrian Klaver 
> (<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>>) escribió:
> 
>     On 6/9/20 10:38 PM, PEDRO PABLO SEVERIN HONORATO wrote:
>      > Thank you, Adrian. Will read about all this. By the way, the issue
>      > reappeared. For some reason, I had to reinstall Anaconda and had to
>      > delete the "PYTHONHOME" variable because I could not launch conda.
>      > Seems that they both fight for the same variable name?
>      > Is there a way to set it to two different names?
> 
>     See below for more information:
> 
>     https://docs.anaconda.com/anaconda/user-guide/faq/#installing-anaconda
>      >
>      > Thanks,
>      > PS
>      >
>      >
> 
> 
>     -- 
>     Adrian Klaver
>     adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Help with plpython3u
  2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:17 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 00:26   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:37     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 01:17       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 02:16         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 05:38           ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:08             ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 14:39               ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:50                 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
@ 2020-06-10 15:25                   ` PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 16:17                     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 21+ messages in thread

From: PEDRO PABLO SEVERIN HONORATO @ 2020-06-10 15:25 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general@lists.postgresql.org

Just to be clear those where instructions from here, correct?:

https://www.enterprisedb.com/edb-docs/d/edb-postgres-advanced-server/user-guides/language-pack-guide...

Yes. When I did that I could execute python functions and create the
extension in postgres without problem, but later I realized that doing this
will create the other problem with anaconda.

So when you did the Anaconda install:

https://docs.anaconda.com/anaconda/install/windows/

What did you check for the Advanced options in Step 8?

I left the first one unchecked and the second one checked, which is the
default settings.

El mié., 10 jun. 2020 a las 10:50, Adrian Klaver (<adrian.klaver@aklaver.com>)
escribió:

> On 6/10/20 7:39 AM, PEDRO PABLO SEVERIN HONORATO wrote:
> > Thank you Adrian, will see the link you sent me.
> >
> > Thank you, Laurenz. I noticed that copying the DLL is not a good idea.
> > How can I set a python path for postgres, so that I tell postgres "hey,
> > if you are looking for python see this path" and don't lose conda?
> > Because after following all Adrian's instructions and  after creating
> > the variable"*PYTHONHOME = C:\edb\languagepack\v1\Python-3.7*" and
>
> Just to be clear those where instructions from here, correct?:
>
>
> https://www.enterprisedb.com/edb-docs/d/edb-postgres-advanced-server/user-guides/language-pack-guide...
>
> > adding *%PYTHONHOME%* to the *PATH, *I get this message when I open
> > Anaconda Prompt:
> > *"File "C:\Users\developer\Anaconda3\Scripts\conda-script.py", line 11,
> > in <module> from conda.cli import main ModuleNotFoundError: No module
> > named 'conda'"*
>
> So when you did the Anaconda install:
>
> https://docs.anaconda.com/anaconda/install/windows/
>
> What did you check for the Advanced options in Step 8?
>
> > *
> > *
> > Then, I removed the variable name PYTHONHOME and tried to execute again
> > Anaconda Prompt without any problem. So I think that postgres and conda
> > are like "fighting" for the PYTHONHOME variable name? Is this correct?
> >
> > El mié., 10 jun. 2020 a las 10:08, Adrian Klaver
> > (<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>>)
> escribió:
> >
> >     On 6/9/20 10:38 PM, PEDRO PABLO SEVERIN HONORATO wrote:
> >      > Thank you, Adrian. Will read about all this. By the way, the issue
> >      > reappeared. For some reason, I had to reinstall Anaconda and had
> to
> >      > delete the "PYTHONHOME" variable because I could not launch conda.
> >      > Seems that they both fight for the same variable name?
> >      > Is there a way to set it to two different names?
> >
> >     See below for more information:
> >
> >
> https://docs.anaconda.com/anaconda/user-guide/faq/#installing-anaconda
> >      >
> >      > Thanks,
> >      > PS
> >      >
> >      >
> >
> >
> >     --
> >     Adrian Klaver
> >     adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
> >
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>

^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Help with plpython3u
  2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:17 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 00:26   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:37     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 01:17       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 02:16         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 05:38           ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:08             ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 14:39               ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:50                 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 15:25                   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
@ 2020-06-10 16:17                     ` Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 16:57                       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  0 siblings, 1 reply; 21+ messages in thread

From: Adrian Klaver @ 2020-06-10 16:17 UTC (permalink / raw)
  To: PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>; +Cc: pgsql-general@lists.postgresql.org

On 6/10/20 8:25 AM, PEDRO PABLO SEVERIN HONORATO wrote:
> Just to be clear those where instructions from here, correct?:
> 
> https://www.enterprisedb.com/edb-docs/d/edb-postgres-advanced-server/user-guides/language-pack-guide...
> 
> Yes. When I did that I could execute python functions and create the 
> extension in postgres without problem, but later I realized that doing 
> this will create the other problem with anaconda.
> 
> So when you did the Anaconda install:
> 
> https://docs.anaconda.com/anaconda/install/windows/
> 
> What did you check for the Advanced options in Step 8?
> 
> I left the first one unchecked and the second one checked, which is the 
> default settings.
> 

Alright. Before we go any further it would be best to determine what 
your needs are. So:

1) Did you install Anaconda just to get Python or for the science data 
set of libraries it provides?

2) Do you need the system Python you installed for anything that 
Anaconda does not provide?

3) What are you planning to do with plpython3u?


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Help with plpython3u
  2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:17 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 00:26   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:37     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 01:17       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 02:16         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 05:38           ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:08             ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 14:39               ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:50                 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 15:25                   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 16:17                     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
@ 2020-06-10 16:57                       ` PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 17:12                         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 21+ messages in thread

From: PEDRO PABLO SEVERIN HONORATO @ 2020-06-10 16:57 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general@lists.postgresql.org

Alright. Before we go any further it would be best to determine what
your needs are. So:

1) Did you install Anaconda just to get Python or for the science data
set of libraries it provides?

A: For the data science set of libraries. Also, it helps to keep libraries
updated.

2) Do you need the system Python you installed for anything that
Anaconda does not provide?

A: I don't know if I understood well this question, but I think the answer
is no. Anaconda does provide almost all the libraries I need. I just
installed a couple more (like talib, tensorflow, keras, psycopg2, etc) and
created some libraries of my own.

3) What are you planning to do with plpython3u?

A: I'm planning to create some functions using python language to process
data that is stored in real time in the database and then use them as
triggers. I would like to be able to import some libraries that I have in
python to do it. Some of the functions are fourier and wavelet transforms.
If I can't import the library, then I'll have to code the full function,
but it's easier (for me) to code them in python language rather than sql
language.

El mié., 10 jun. 2020 a las 12:17, Adrian Klaver (<adrian.klaver@aklaver.com>)
escribió:

> On 6/10/20 8:25 AM, PEDRO PABLO SEVERIN HONORATO wrote:
> > Just to be clear those where instructions from here, correct?:
> >
> >
> https://www.enterprisedb.com/edb-docs/d/edb-postgres-advanced-server/user-guides/language-pack-guide...
> >
> > Yes. When I did that I could execute python functions and create the
> > extension in postgres without problem, but later I realized that doing
> > this will create the other problem with anaconda.
> >
> > So when you did the Anaconda install:
> >
> > https://docs.anaconda.com/anaconda/install/windows/
> >
> > What did you check for the Advanced options in Step 8?
> >
> > I left the first one unchecked and the second one checked, which is the
> > default settings.
> >
>
> Alright. Before we go any further it would be best to determine what
> your needs are. So:
>
> 1) Did you install Anaconda just to get Python or for the science data
> set of libraries it provides?
>
> 2) Do you need the system Python you installed for anything that
> Anaconda does not provide?
>
> 3) What are you planning to do with plpython3u?
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>

^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Help with plpython3u
  2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:17 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 00:26   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:37     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 01:17       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 02:16         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 05:38           ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:08             ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 14:39               ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:50                 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 15:25                   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 16:17                     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 16:57                       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
@ 2020-06-10 17:12                         ` Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 17:36                           ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  0 siblings, 1 reply; 21+ messages in thread

From: Adrian Klaver @ 2020-06-10 17:12 UTC (permalink / raw)
  To: PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>; +Cc: pgsql-general@lists.postgresql.org

On 6/10/20 9:57 AM, PEDRO PABLO SEVERIN HONORATO wrote:
> Alright. Before we go any further it would be best to determine what
> your needs are. So:
> 
> 1) Did you install Anaconda just to get Python or for the science data
> set of libraries it provides?
> 
> A: For the data science set of libraries. Also, it helps to keep 
> libraries updated.
> 
> 2) Do you need the system Python you installed for anything that
> Anaconda does not provide?
> 
> A: I don't know if I understood well this question, but I think the 
> answer is no. Anaconda does provide almost all the libraries I need. I 
> just installed a couple more (like talib, tensorflow, keras, psycopg2, 
> etc) and created some libraries of my own.

Those libraries are available from Anaconda:

https://docs.anaconda.com/anaconda/packages/py3.7_win-64/

or from AnacondaCloud:

https://anaconda.org/

I just think it would make your life easier to reduce the number of 
Python installs you have. If I'm keeping track correctly you now have:

1) Anaconda Python

2) OS system Python

3) EDB Python.


What happens if you try to create a plpythonu3u function in the database?


> 
> 3) What are you planning to do with plpython3u?
> 
> A: I'm planning to create some functions using python language to 
> process data that is stored in real time in the database and then use 
> them as triggers. I would like to be able to import some libraries that 
> I have in python to do it. Some of the functions are fourier and wavelet 
> transforms. If I can't import the library, then I'll have to code the 
> full function, but it's easier (for me) to code them in python language 
> rather than sql language.
> 
> El mié., 10 jun. 2020 a las 12:17, Adrian Klaver 
> (<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>>) escribió:
> 
>     On 6/10/20 8:25 AM, PEDRO PABLO SEVERIN HONORATO wrote:
>      > Just to be clear those where instructions from here, correct?:
>      >
>      >
>     https://www.enterprisedb.com/edb-docs/d/edb-postgres-advanced-server/user-guides/language-pack-guide...
>      >
>      > Yes. When I did that I could execute python functions and create the
>      > extension in postgres without problem, but later I realized that
>     doing
>      > this will create the other problem with anaconda.
>      >
>      > So when you did the Anaconda install:
>      >
>      > https://docs.anaconda.com/anaconda/install/windows/
>      >
>      > What did you check for the Advanced options in Step 8?
>      >
>      > I left the first one unchecked and the second one checked, which
>     is the
>      > default settings.
>      >
> 
>     Alright. Before we go any further it would be best to determine what
>     your needs are. So:
> 
>     1) Did you install Anaconda just to get Python or for the science data
>     set of libraries it provides?
> 
>     2) Do you need the system Python you installed for anything that
>     Anaconda does not provide?
> 
>     3) What are you planning to do with plpython3u?
> 
> 
>     -- 
>     Adrian Klaver
>     adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Help with plpython3u
  2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:17 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 00:26   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:37     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 01:17       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 02:16         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 05:38           ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:08             ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 14:39               ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:50                 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 15:25                   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 16:17                     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 16:57                       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 17:12                         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
@ 2020-06-10 17:36                           ` PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 17:39                             ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  0 siblings, 1 reply; 21+ messages in thread

From: PEDRO PABLO SEVERIN HONORATO @ 2020-06-10 17:36 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general@lists.postgresql.org

I just think it would make your life easier to reduce the number of
Python installs you have. If I'm keeping track correctly you now have:

1) Anaconda Python

2) OS system Python

3) EDB Python.

The OS is windows, and afaik python is not included in windows, so it would
be just Anaconda python and EDB python.

What happens if you try to create a plpythonu3u function in the database?

The database crashes and tells me "*Connection to the server has been lost.*
"

El mié., 10 jun. 2020 a las 13:12, Adrian Klaver (<adrian.klaver@aklaver.com>)
escribió:

> On 6/10/20 9:57 AM, PEDRO PABLO SEVERIN HONORATO wrote:
> > Alright. Before we go any further it would be best to determine what
> > your needs are. So:
> >
> > 1) Did you install Anaconda just to get Python or for the science data
> > set of libraries it provides?
> >
> > A: For the data science set of libraries. Also, it helps to keep
> > libraries updated.
> >
> > 2) Do you need the system Python you installed for anything that
> > Anaconda does not provide?
> >
> > A: I don't know if I understood well this question, but I think the
> > answer is no. Anaconda does provide almost all the libraries I need. I
> > just installed a couple more (like talib, tensorflow, keras, psycopg2,
> > etc) and created some libraries of my own.
>
> Those libraries are available from Anaconda:
>
> https://docs.anaconda.com/anaconda/packages/py3.7_win-64/
>
> or from AnacondaCloud:
>
> https://anaconda.org/
>
> I just think it would make your life easier to reduce the number of
> Python installs you have. If I'm keeping track correctly you now have:
>
> 1) Anaconda Python
>
> 2) OS system Python
>
> 3) EDB Python.
>
>
> What happens if you try to create a plpythonu3u function in the database?
>
>
> >
> > 3) What are you planning to do with plpython3u?
> >
> > A: I'm planning to create some functions using python language to
> > process data that is stored in real time in the database and then use
> > them as triggers. I would like to be able to import some libraries that
> > I have in python to do it. Some of the functions are fourier and wavelet
> > transforms. If I can't import the library, then I'll have to code the
> > full function, but it's easier (for me) to code them in python language
> > rather than sql language.
> >
> > El mié., 10 jun. 2020 a las 12:17, Adrian Klaver
> > (<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>>)
> escribió:
> >
> >     On 6/10/20 8:25 AM, PEDRO PABLO SEVERIN HONORATO wrote:
> >      > Just to be clear those where instructions from here, correct?:
> >      >
> >      >
> >
> https://www.enterprisedb.com/edb-docs/d/edb-postgres-advanced-server/user-guides/language-pack-guide...
> >      >
> >      > Yes. When I did that I could execute python functions and create
> the
> >      > extension in postgres without problem, but later I realized that
> >     doing
> >      > this will create the other problem with anaconda.
> >      >
> >      > So when you did the Anaconda install:
> >      >
> >      > https://docs.anaconda.com/anaconda/install/windows/
> >      >
> >      > What did you check for the Advanced options in Step 8?
> >      >
> >      > I left the first one unchecked and the second one checked, which
> >     is the
> >      > default settings.
> >      >
> >
> >     Alright. Before we go any further it would be best to determine what
> >     your needs are. So:
> >
> >     1) Did you install Anaconda just to get Python or for the science
> data
> >     set of libraries it provides?
> >
> >     2) Do you need the system Python you installed for anything that
> >     Anaconda does not provide?
> >
> >     3) What are you planning to do with plpython3u?
> >
> >
> >     --
> >     Adrian Klaver
> >     adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
> >
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>

^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Help with plpython3u
  2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:17 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 00:26   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:37     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 01:17       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 02:16         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 05:38           ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:08             ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 14:39               ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:50                 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 15:25                   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 16:17                     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 16:57                       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 17:12                         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 17:36                           ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
@ 2020-06-10 17:39                             ` PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 17:44                               ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 22:19                               ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 2 replies; 21+ messages in thread

From: PEDRO PABLO SEVERIN HONORATO @ 2020-06-10 17:39 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general@lists.postgresql.org

I'm sorry, when I try to create a plpython3u function, the database tells
me:

"

*ERROR: could not load library
"C:/ProgramFiles/PostgreSQL/12/lib/plpython3.dll": The specified module
could notbe found. SQL state: 58P01*"

If I try to execute the function, then the database crashes.

El mié., 10 jun. 2020 a las 13:36, PEDRO PABLO SEVERIN HONORATO (<
ppseverin@miuandes.cl>) escribió:

> I just think it would make your life easier to reduce the number of
> Python installs you have. If I'm keeping track correctly you now have:
>
> 1) Anaconda Python
>
> 2) OS system Python
>
> 3) EDB Python.
>
> The OS is windows, and afaik python is not included in windows, so it
> would be just Anaconda python and EDB python.
>
> What happens if you try to create a plpythonu3u function in the database?
>
> The database crashes and tells me "*Connection to the server has been
> lost.*"
>
> El mié., 10 jun. 2020 a las 13:12, Adrian Klaver (<
> adrian.klaver@aklaver.com>) escribió:
>
>> On 6/10/20 9:57 AM, PEDRO PABLO SEVERIN HONORATO wrote:
>> > Alright. Before we go any further it would be best to determine what
>> > your needs are. So:
>> >
>> > 1) Did you install Anaconda just to get Python or for the science data
>> > set of libraries it provides?
>> >
>> > A: For the data science set of libraries. Also, it helps to keep
>> > libraries updated.
>> >
>> > 2) Do you need the system Python you installed for anything that
>> > Anaconda does not provide?
>> >
>> > A: I don't know if I understood well this question, but I think the
>> > answer is no. Anaconda does provide almost all the libraries I need. I
>> > just installed a couple more (like talib, tensorflow, keras, psycopg2,
>> > etc) and created some libraries of my own.
>>
>> Those libraries are available from Anaconda:
>>
>> https://docs.anaconda.com/anaconda/packages/py3.7_win-64/
>>
>> or from AnacondaCloud:
>>
>> https://anaconda.org/
>>
>> I just think it would make your life easier to reduce the number of
>> Python installs you have. If I'm keeping track correctly you now have:
>>
>> 1) Anaconda Python
>>
>> 2) OS system Python
>>
>> 3) EDB Python.
>>
>>
>> What happens if you try to create a plpythonu3u function in the database?
>>
>>
>> >
>> > 3) What are you planning to do with plpython3u?
>> >
>> > A: I'm planning to create some functions using python language to
>> > process data that is stored in real time in the database and then use
>> > them as triggers. I would like to be able to import some libraries that
>> > I have in python to do it. Some of the functions are fourier and
>> wavelet
>> > transforms. If I can't import the library, then I'll have to code the
>> > full function, but it's easier (for me) to code them in python language
>> > rather than sql language.
>> >
>> > El mié., 10 jun. 2020 a las 12:17, Adrian Klaver
>> > (<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>>)
>> escribió:
>> >
>> >     On 6/10/20 8:25 AM, PEDRO PABLO SEVERIN HONORATO wrote:
>> >      > Just to be clear those where instructions from here, correct?:
>> >      >
>> >      >
>> >
>> https://www.enterprisedb.com/edb-docs/d/edb-postgres-advanced-server/user-guides/language-pack-guide...
>> >      >
>> >      > Yes. When I did that I could execute python functions and create
>> the
>> >      > extension in postgres without problem, but later I realized that
>> >     doing
>> >      > this will create the other problem with anaconda.
>> >      >
>> >      > So when you did the Anaconda install:
>> >      >
>> >      > https://docs.anaconda.com/anaconda/install/windows/
>> >      >
>> >      > What did you check for the Advanced options in Step 8?
>> >      >
>> >      > I left the first one unchecked and the second one checked, which
>> >     is the
>> >      > default settings.
>> >      >
>> >
>> >     Alright. Before we go any further it would be best to determine what
>> >     your needs are. So:
>> >
>> >     1) Did you install Anaconda just to get Python or for the science
>> data
>> >     set of libraries it provides?
>> >
>> >     2) Do you need the system Python you installed for anything that
>> >     Anaconda does not provide?
>> >
>> >     3) What are you planning to do with plpython3u?
>> >
>> >
>> >     --
>> >     Adrian Klaver
>> >     adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
>> >
>>
>>
>> --
>> Adrian Klaver
>> adrian.klaver@aklaver.com
>>
>

^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Help with plpython3u
  2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:17 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 00:26   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:37     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 01:17       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 02:16         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 05:38           ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:08             ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 14:39               ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:50                 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 15:25                   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 16:17                     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 16:57                       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 17:12                         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 17:36                           ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 17:39                             ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
@ 2020-06-10 17:44                               ` Adrian Klaver <adrian.klaver@aklaver.com>
  1 sibling, 0 replies; 21+ messages in thread

From: Adrian Klaver @ 2020-06-10 17:44 UTC (permalink / raw)
  To: PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>; +Cc: pgsql-general@lists.postgresql.org

On 6/10/20 10:39 AM, PEDRO PABLO SEVERIN HONORATO wrote:
> I'm sorry, when I try to create a plpython3u function, the database 
> tells me:
> 
> "*ERROR: could not load library "C:/Program
> Files/PostgreSQL/12/lib/plpython3.dll": The specified module could not
> be found. SQL state: 58P01*"
> 
> If I try to execute the function, then the database crashes.

Alright I'm going to have to review where we are at. That will not 
happen for a bit, so hang on.

> 
> El mié., 10 jun. 2020 a las 13:36, PEDRO PABLO SEVERIN HONORATO 
> (<ppseverin@miuandes.cl <mailto:ppseverin@miuandes.cl>>) escribió:
> 
>     I just think it would make your life easier to reduce the number of
>     Python installs you have. If I'm keeping track correctly you now have:
> 
>     1) Anaconda Python
> 
>     2) OS system Python
> 
>     3) EDB Python.
> 
>     The OS is windows, and afaik python is not included in windows, so
>     it would be just Anaconda python and EDB python.
> 
>     What happens if you try to create a plpythonu3u function in the
>     database?
> 
>     The database crashes and tells me "*Connection to the server has
>     been lost.*"
> 
>     El mié., 10 jun. 2020 a las 13:12, Adrian Klaver
>     (<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>>)
>     escribió:
> 
>         On 6/10/20 9:57 AM, PEDRO PABLO SEVERIN HONORATO wrote:
>          > Alright. Before we go any further it would be best to
>         determine what
>          > your needs are. So:
>          >
>          > 1) Did you install Anaconda just to get Python or for the
>         science data
>          > set of libraries it provides?
>          >
>          > A: For the data science set of libraries. Also, it helps to keep
>          > libraries updated.
>          >
>          > 2) Do you need the system Python you installed for anything that
>          > Anaconda does not provide?
>          >
>          > A: I don't know if I understood well this question, but I
>         think the
>          > answer is no. Anaconda does provide almost all the libraries
>         I need. I
>          > just installed a couple more (like talib, tensorflow, keras,
>         psycopg2,
>          > etc) and created some libraries of my own.
> 
>         Those libraries are available from Anaconda:
> 
>         https://docs.anaconda.com/anaconda/packages/py3.7_win-64/
> 
>         or from AnacondaCloud:
> 
>         https://anaconda.org/
> 
>         I just think it would make your life easier to reduce the number of
>         Python installs you have. If I'm keeping track correctly you now
>         have:
> 
>         1) Anaconda Python
> 
>         2) OS system Python
> 
>         3) EDB Python.
> 
> 
>         What happens if you try to create a plpythonu3u function in the
>         database?
> 
> 
>          >
>          > 3) What are you planning to do with plpython3u?
>          >
>          > A: I'm planning to create some functions using python
>         language to
>          > process data that is stored in real time in the database and
>         then use
>          > them as triggers. I would like to be able to import some
>         libraries that
>          > I have in python to do it. Some of the functions are fourier
>         and wavelet
>          > transforms. If I can't import the library, then I'll have to
>         code the
>          > full function, but it's easier (for me) to code them in
>         python language
>          > rather than sql language.
>          >
>          > El mié., 10 jun. 2020 a las 12:17, Adrian Klaver
>          > (<adrian.klaver@aklaver.com
>         <mailto:adrian.klaver@aklaver.com>
>         <mailto:adrian.klaver@aklaver.com
>         <mailto:adrian.klaver@aklaver.com>>>) escribió:
>          >
>          >     On 6/10/20 8:25 AM, PEDRO PABLO SEVERIN HONORATO wrote:
>          >      > Just to be clear those where instructions from here,
>         correct?:
>          >      >
>          >      >
>          >
>         https://www.enterprisedb.com/edb-docs/d/edb-postgres-advanced-server/user-guides/language-pack-guide...
>          >      >
>          >      > Yes. When I did that I could execute python functions
>         and create the
>          >      > extension in postgres without problem, but later I
>         realized that
>          >     doing
>          >      > this will create the other problem with anaconda.
>          >      >
>          >      > So when you did the Anaconda install:
>          >      >
>          >      > https://docs.anaconda.com/anaconda/install/windows/
>          >      >
>          >      > What did you check for the Advanced options in Step 8?
>          >      >
>          >      > I left the first one unchecked and the second one
>         checked, which
>          >     is the
>          >      > default settings.
>          >      >
>          >
>          >     Alright. Before we go any further it would be best to
>         determine what
>          >     your needs are. So:
>          >
>          >     1) Did you install Anaconda just to get Python or for the
>         science data
>          >     set of libraries it provides?
>          >
>          >     2) Do you need the system Python you installed for
>         anything that
>          >     Anaconda does not provide?
>          >
>          >     3) What are you planning to do with plpython3u?
>          >
>          >
>          >     --
>          >     Adrian Klaver
>          > adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
>         <mailto:adrian.klaver@aklaver.com
>         <mailto:adrian.klaver@aklaver.com>>
>          >
> 
> 
>         -- 
>         Adrian Klaver
>         adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Help with plpython3u
  2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:17 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 00:26   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:37     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 01:17       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 02:16         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 05:38           ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:08             ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 14:39               ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:50                 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 15:25                   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 16:17                     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 16:57                       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 17:12                         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 17:36                           ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 17:39                             ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
@ 2020-06-10 22:19                               ` Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 23:35                                 ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  1 sibling, 1 reply; 21+ messages in thread

From: Adrian Klaver @ 2020-06-10 22:19 UTC (permalink / raw)
  To: PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>; +Cc: pgsql-general@lists.postgresql.org

On 6/10/20 10:39 AM, PEDRO PABLO SEVERIN HONORATO wrote:
> I'm sorry, when I try to create a plpython3u function, the database 
> tells me:
> 
> "*ERROR: could not load library "C:/Program
> Files/PostgreSQL/12/lib/plpython3.dll": The specified module could not
> be found. SQL state: 58P01*"
> 
> If I try to execute the function, then the database crashes.
> 

Alright that was not fun. I pulled up an Windows 7 machine and installed 
Anaconda and Postgres from EDB. I installed Anaconda with the defaults 
you mentioned. I could not get Anaconda and Postgres to work together 
with regards to Python. As you have found the PYTHONHOME setting 
Postgres needs is picked up by Anaconda and prevents it from starting. 
Dropping PYTHONHOME  allows Anaconda to work but causes plpython3u to 
fail. To me the solution would be to have something like EDB_PYTHONHOME 
that only the Postgres install would use. I could not find anything like 
that though. I'm out of ideas. I now remember why I don't use Windows:( 
I was going to point you at the EDB forums, but they don't exist 
anymore. I guess you have to ask questions on Stackoverflow:

https://stackoverflow.com/questions/tagged/enterprisedb

I would try there.


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Help with plpython3u
  2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:17 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 00:26   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:37     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 01:17       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 02:16         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 05:38           ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:08             ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 14:39               ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:50                 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 15:25                   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 16:17                     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 16:57                       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 17:12                         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 17:36                           ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 17:39                             ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 22:19                               ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
@ 2020-06-10 23:35                                 ` PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-11 00:15                                   ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 21+ messages in thread

From: PEDRO PABLO SEVERIN HONORATO @ 2020-06-10 23:35 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general@lists.postgresql.org

something like EDB_PYTHONHOME
that only the Postgres install would use.

That's exactly what I was looking for. Isn't a way to configure some
postgres file, so that postgres would use that file and look for python in
that directory before seeing the path?

I guess you have to ask questions on Stackoverflow

Stackoverflow was the first place where I asked this, but with less
knowledge than now. Maybe now I can ask a more concrete question about
paths.

Anyways, thank you very much for your time, Adrian. I really appreciate it.
If I manage to solve this I'll let you know, so if anyone else has the
same problem.

El mié., 10 jun. 2020 a las 18:19, Adrian Klaver (<adrian.klaver@aklaver.com>)
escribió:

> On 6/10/20 10:39 AM, PEDRO PABLO SEVERIN HONORATO wrote:
> > I'm sorry, when I try to create a plpython3u function, the database
> > tells me:
> >
> > "*ERROR: could not load library "C:/Program
> > Files/PostgreSQL/12/lib/plpython3.dll": The specified module could not
> > be found. SQL state: 58P01*"
> >
> > If I try to execute the function, then the database crashes.
> >
>
> Alright that was not fun. I pulled up an Windows 7 machine and installed
> Anaconda and Postgres from EDB. I installed Anaconda with the defaults
> you mentioned. I could not get Anaconda and Postgres to work together
> with regards to Python. As you have found the PYTHONHOME setting
> Postgres needs is picked up by Anaconda and prevents it from starting.
> Dropping PYTHONHOME  allows Anaconda to work but causes plpython3u to
> fail. To me the solution would be to have something like EDB_PYTHONHOME
> that only the Postgres install would use. I could not find anything like
> that though. I'm out of ideas. I now remember why I don't use Windows:(
> I was going to point you at the EDB forums, but they don't exist
> anymore. I guess you have to ask questions on Stackoverflow:
>
> https://stackoverflow.com/questions/tagged/enterprisedb
>
> I would try there.
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>

^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Help with plpython3u
  2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:17 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 00:26   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:37     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 01:17       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 02:16         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 05:38           ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:08             ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 14:39               ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 14:50                 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 15:25                   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 16:17                     ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 16:57                       ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 17:12                         ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 17:36                           ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 17:39                             ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 22:19                               ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 23:35                                 ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
@ 2020-06-11 00:15                                   ` Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 0 replies; 21+ messages in thread

From: Adrian Klaver @ 2020-06-11 00:15 UTC (permalink / raw)
  To: PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>; +Cc: pgsql-general@lists.postgresql.org

On 6/10/20 4:35 PM, PEDRO PABLO SEVERIN HONORATO wrote:
> something like EDB_PYTHONHOME
> that only the Postgres install would use.
> 
> That's exactly what I was looking for. Isn't a way to configure some 
> postgres file, so that postgres would use that file and look for python 
> in that directory before seeing the path?

That is not something that is native to Postgres. The issue is that EDB 
bundles a Python version with the Language Pack and points the 
plpython(3)u extensions at it. I understand that, as they can't count on 
Python being installed as in Unix(en) OS'es or invoke a package manager 
to satisfy the dependency. The problem is when you do install some other 
form of Python on your Windows machine. Then you get the conflicts.

> 
> I guess you have to ask questions on Stackoverflow
> 
> Stackoverflow was the first place where I asked this, but with less 
> knowledge than now. Maybe now I can ask a more concrete question about 
> paths.
> 
> Anyways, thank you very much for your time, Adrian. I really appreciate 
> it. If I manage to solve this I'll let you know, so if anyone else has 
> the same problem.
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Help with plpython3u
  2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
  2020-06-10 00:17 ` Re: Help with plpython3u Adrian Klaver <adrian.klaver@aklaver.com>
  2020-06-10 00:26   ` Re: Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
@ 2020-06-10 06:49     ` Laurenz Albe <laurenz.albe@cybertec.at>
  1 sibling, 0 replies; 21+ messages in thread

From: Laurenz Albe @ 2020-06-10 06:49 UTC (permalink / raw)
  To: PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>; Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general@lists.postgresql.org

On Tue, 2020-06-09 at 20:26 -0400, PEDRO PABLO SEVERIN HONORATO wrote:
> I installed Postgres downloading the file posgresql-12.2-1-windows-x64 from the website https://www.postgresql.org/download/windows/. 
> 
> The python37.dll I copied to the System32 folder was located in C:\Users\developer\Anaconda3.
> After trying this, I installed python 3.7.0 and copied the python37.dll that comes with the installation, but got the same result.

Do not copy libraries around.  That's a road to hell.
Instead, add them to the PATH.
The library might depend on something else at the original location.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






^ permalink  raw  reply  [nested|flat] 21+ messages in thread


end of thread, other threads:[~2020-06-11 00:15 UTC | newest]

Thread overview: 21+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-06-10 00:09 Help with plpython3u PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
2020-06-10 00:17 ` Adrian Klaver <adrian.klaver@aklaver.com>
2020-06-10 00:26   ` PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
2020-06-10 00:37     ` Adrian Klaver <adrian.klaver@aklaver.com>
2020-06-10 01:17       ` PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
2020-06-10 02:16         ` Adrian Klaver <adrian.klaver@aklaver.com>
2020-06-10 05:38           ` PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
2020-06-10 14:08             ` Adrian Klaver <adrian.klaver@aklaver.com>
2020-06-10 14:39               ` PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
2020-06-10 14:50                 ` Adrian Klaver <adrian.klaver@aklaver.com>
2020-06-10 15:25                   ` PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
2020-06-10 16:17                     ` Adrian Klaver <adrian.klaver@aklaver.com>
2020-06-10 16:57                       ` PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
2020-06-10 17:12                         ` Adrian Klaver <adrian.klaver@aklaver.com>
2020-06-10 17:36                           ` PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
2020-06-10 17:39                             ` PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
2020-06-10 17:44                               ` Adrian Klaver <adrian.klaver@aklaver.com>
2020-06-10 22:19                               ` Adrian Klaver <adrian.klaver@aklaver.com>
2020-06-10 23:35                                 ` PEDRO PABLO SEVERIN HONORATO <ppseverin@miuandes.cl>
2020-06-11 00:15                                   ` Adrian Klaver <adrian.klaver@aklaver.com>
2020-06-10 06:49     ` Laurenz Albe <laurenz.albe@cybertec.at>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox