Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Inline::Python and PYTHONPATH

6 views
Skip to first unread message

Stefan Seifert

unread,
Jul 22, 2018, 6:00:02 AM7/22/18
to inl...@perl.org, ejm
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
0 new messages