-
-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
espanso will only use system-installed interpreters #1950
Comments
I think A workaround for Python for now may be to define a global variable for the interpreter path, depending on the OS. E.g.: global_vars:
- name: python # Linux
type: echo
params:
echo: /usr/bin/python for use in expansions: - trigger: :test
replace: "{{output}}"
vars:
- name: output
type: script
params:
args: ["{{python}}", -c, print("something")] or args: ["{{python}}", /path/to/your/script.py] for example. But, I can see, one still has to use the absolute path, so that may not help. import os; print(os.path.join(os.getenv("PYENV_ROOT"), "shims", "python")) ? |
Thanks for the reply, smeech! Using global variable is indeed my current workaround. Was just wondering if we can set it up outside the matches entirely, as I'm syncing the matches files between platforms. |
Ideally one would be able to use |
Mmmmmmm. This hack works, but is the definitive solution we want? |
It's not ideal, but it's for a fairly narrow use-case, where someone wants to use a different version than the system standard version, without hard-coding the path (in order to use it across OSs). Unless this is easy to implement, it's unlikely to happen. |
Yeah, I would be happy with this hack, but it's not recommended to use the OS default python, especially in Linux environments. I'm happy with agreeing a solution and move it to the prioritization queue (the project board). It will be done when it's ready 🚀 |
Description
Hi there, is there a way to make espanso use a different Python version installed in the system?
I'm using pyenv in both macOS and Linux to set latest Python version globally, and espanso stubbornly keeps using system-installed version.
In my use case, setting absolute path in the script extension is really not preferred, as I'm syncing the match folder and its content between Windows, macOS, and Linux systems.
EDIT:
It seems that this also affects shell extension, as I have PowerShell 7.4 installed in my Windows machine.
In Windows, possible values for the
shell
parameter arecmd
,powershell
,wsl
. Definingpowershell
will simply use the out-of-the-box PowerShell version 5.1.Defining
pwsh
as value will simply output this error:Is there a way to define absolute path of the interpreter as variables, perhaps in
default.yml
, so one can maintain consistent matches files across different platforms?The text was updated successfully, but these errors were encountered: