jupyter / jupyter_core

Core Jupyter functionality
https://jupyter-core.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
195 stars 181 forks source link

put_script_path first #340

Closed bluecoconut closed 1 year ago

bluecoconut commented 1 year ago

Not actually a suggested PR -- I suspect that there's other work here.

Opening this as a fix for the issue https://github.com/jupyter/jupyter_core/issues/339

It might be the case that I'm misunderstanding the JUPYTER_PREFER_ENV_PATH. It is a flag that gets set when in virtualenvs, for the other paths.py part of the work. This seems unrelated to "OS PATH" style stuff. However, it is the case that I want the script directory (the one found via sysconfig.get_path("scripts")) to be the preferred path for subcommand execution.

By adding these lines to my jupyter-core, my issues went away. I was now no longer getting shorted out by the wrong scripts / shims from pyenv. (I think it's a separate issue that the shim was resolving incorrectly to nothing)