question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

allow python path to be modified with an environment variable

See original GitHub issue

Observed behavior

Currently there is no way to use external settings files or install additional kolibri plugins with a PEX files.

Expected behavior

We can add support for a new environment variable, e.g. KOLIBRI_ADDITIONAL_PY. When set, this value will be prepended to the internal python path, allowing additional packages to be referenced by the PEX.

User-facing consequences

Without this, have to choose between being able to use external packages or having a portable, downloadable executable.

Context

0.11.x


cc @jamalex @aronasorman

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
indirectlylitcommented, Nov 16, 2019

This was resolved during investigation of using the Sentry SDK in https://github.com/learningequality/kolibri/pull/5773

The key here was to set the environment variable PEX_INHERIT_PATH=1: https://pex.readthedocs.io/en/stable/api/index.html#pex.variables.Variables.PEX_INHERIT_PATH

This lets the pex inherit the Python path of the active Python environment.

0reactions
indirectlylitcommented, Dec 20, 2019

setting the variable PEX_INHERIT_PATH=1 is necessary for any situation where a user has installed using the pex and tries to enable an external plugin.

We don’t publicly document plugin enable/disable functionality because it’s not stable yet, but when we do we’ll need to add this as a note. Opened a tracker issue here: https://github.com/learningequality/kolibri-docs/issues/149

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to modify windows 10 path variable directly from a python ...
The idea is that you can call the setx command from python and use it to update the path variable. You should be...
Read more >
How to add Python Path to Windows 10 PATH - Liquid Web
Method 2 · Step 1. Open an administrative command prompt by going to · Step 2. Once the Type in the python command,...
Read more >
4. Using Python on Windows — Python 3.11.1 documentation
To permanently modify the default environment variables, click Start and search for 'edit environment variables', or open System properties, Advanced system ...
Read more >
How to Add Python Installation to Path Environment variable ...
In this tutorial you will learn How to Add Python Installation to Path Environment variable in Windows 10.When we install we have an...
Read more >
How to add Python to PATH variable in Windows - Educative.io
PATH variable · Right-clicking This PC and going to Properties. · Clicking on the Advanced system settings in the menu on the left....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found