Leo Integ: leo path
October 20, 2023
Get Leo's installation path automatically (if installed with pip) #216
Ville M. Vainio proposed that the Leo path setting could be set automatically if Leo was installed with pip.
So a good improvement would be that on installation, and on upgrade, check with:
python -c "import leo; import os; print(os.path.dirname(leo.__file__))"
(or somesuch) to get the Leo Editor's installation path and set it automatically (if not already set), allowing the user to skip this step before its first LeoInteg usage.
From < https://github.com/boltex/leointeg/issues/216>
this assumes:
- default python in path is where Leo is installed
other possibles:
- Leo installed with pipx --> Leo is in path, but any python in path will not know about it --> use Leo to report where it is
- Leo installed in conda or venv that is not path. --> I don’t there's anything reasonable we can do here.
- Unless there is a light way of interrogating for existence of conda envs?
MAMBA_ROOT_PREFIX
CONDA_ROOT_PREFIX
- If python.launcher search those paths?
C:\Users\Matt>py -0p
-V:3.12 * C:\apps\python\python.exe
-V:ContinuumAnalytics/Anaconda39-64 c:\apps\miniconda3\python.exe
what if more than one Leo is found?
- list them --> choose?