Groups | Search | Server Info | Login | Register


Groups > perl.inline > #19

Re: Inline::Python and PYTHONPATH

Newsgroups perl.inline
Subject Re: Inline::Python and PYTHONPATH
Date 2018-07-22 11:35 +0200
Message-ID <2142384.4kK2PRFflA@sunshine.detonation.org> (permalink)
References <554893965.3663.1532103370748@wamui-merida.atl.sa.earthlink.net>
From nine@detonation.org (Stefan Seifert)

Show all headers | View raw


On Freitag, 20. Juli 2018 18:16:10 CEST ejm wrote:

> When I place the same Perl code in the codebase that it will execute in, run
> by Apache, the method py_eval, called from the load method in
> Inline::Python, fails to find the python module.  Adding a declaration of
> PYTHONPATH in the Perl code to include the directory where the python
> module is located did no good.

That's probably because Python and Perl don't share a view of the environment 
variables, i.e. when you set the environment variable in Perl, Python has 
already read it and set up it's library search paths. So either you make sure 
that Apache runs with that environment variable set and forwards it to your 
Perl script, or you could try setting the variable in a BEGIN block before 
ever loading Inline::Python.

Cheers,
Stefan

Back to perl.inline | Previous | Next | Find similar


Thread

Re: Inline::Python and PYTHONPATH nine@detonation.org (Stefan Seifert) - 2018-07-22 11:35 +0200

csiph-web