IchNar
IchNar

Reputation: 11

How do I set relative path as interpreter path xlwings custom add-in

I have made custom add-in using xlwings. I have one dictionary where is: phodnota.py, phodnota.xlam and Python311 (dictionary with python interpreter and all needed libraries). The problem is that when I try to add into the Interpreter path relative path Python311\python.exe it just doesn't work. I keep getting errors. I could not find the interpreter, but when I add whole path like C:\Users..... it works. My question is: is there a way to add to the interpreter path relative path? Thanks for help.

Upvotes: 0

Views: 119

Answers (1)

tha man
tha man

Reputation: 1

Create a vba function that returns the workbook's full path using ThisWorkbook.Path and in xlwing's interpreter setting (in the xlwings.conf sheet) concatenate it with the relative path to python.exe. e.g., if ThisWorkbook.Path is "c:\myProject" the interpreter setting would look something like: "c:\myProject\venv\Scripts\python.exe"

Upvotes: -1

Related Questions