using conda environment for plpython3u?

Started by Celia McInnisover 8 years ago3 messagesgeneral
Jump to latest
#1Celia McInnis
celia.mcinnis@gmail.com

Is it possible for users to use their conda environment for plpython,
complete with the modules that they have loaded in that environment? If so,
what do I do?

I am running postgres 9.6.2 and would like to use a conda environment for
python 3.6 which contrains a fair number of modules that I want to use
(eg., regex, recordclass, pandas, ...).

#2John R Pierce
pierce@hogranch.com
In reply to: Celia McInnis (#1)
Re: using conda environment for plpython3u?

On 10/23/2017 2:05 PM, Celia McInnis wrote:

Is it possible for users to use their conda environment for plpython,
complete with the modules that they have loaded in that environment?
If so, what do I do?

I am running postgres 9.6.2 and would like to use a conda environment
for python 3.6 which contrains a fair number of modules that I want to
use (eg., regex, recordclass, pandas, ...).

plpython runs in the context of the server user, not the end user.   as
long as you can maket his 'conda environment' available to that user,
and it doesn't violate the single threaded design of a postgres
connection, I dunno why not.

that said, everything you do in a PL is running in the process context
of the core database server.   I'm very very hesitant to drag in large
complex external systems, and would generally prefer to do that sort of
thing in an app server context outside the DB server.

--
john r pierce, recycling bits in santa cruz

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Celia McInnis
celia.mcinnis@gmail.com
In reply to: John R Pierce (#2)
Re: using conda environment for plpython3u?

I am the server user. How do I make my conda environment available? It
seems as though plpython is using python 3.5.2, whereas my conda
environment is using python 3.6, and I don't have the modules loaded that I
need.

On Mon, Oct 23, 2017 at 5:42 PM, John R Pierce <pierce@hogranch.com> wrote:

Show quoted text

On 10/23/2017 2:05 PM, Celia McInnis wrote:

Is it possible for users to use their conda environment for plpython,
complete with the modules that they have loaded in that environment? If so,
what do I do?

I am running postgres 9.6.2 and would like to use a conda environment for
python 3.6 which contrains a fair number of modules that I want to use
(eg., regex, recordclass, pandas, ...).

plpython runs in the context of the server user, not the end user. as
long as you can maket his 'conda environment' available to that user, and
it doesn't violate the single threaded design of a postgres connection, I
dunno why not.

that said, everything you do in a PL is running in the process context of
the core database server. I'm very very hesitant to drag in large complex
external systems, and would generally prefer to do that sort of thing in an
app server context outside the DB server.

--
john r pierce, recycling bits in santa cruz

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general