Skip to content

Commit e23aada

Browse files
bahugomfussenegger
authored andcommitted
Fix python path for Conda on windows
1 parent 4b509fd commit e23aada

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

lua/dap-python.lua

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,22 @@ end
4848

4949

5050
local get_python_path = function()
51-
local venv_path = os.getenv('VIRTUAL_ENV') or os.getenv('CONDA_PREFIX')
51+
local venv_path = os.getenv('VIRTUAL_ENV')
5252
if venv_path then
5353
if is_windows() then
54-
return venv_path .. '\\Scripts\\python.exe'
54+
return venv_path .. '\\Scripts\\python.exe'
5555
end
5656
return venv_path .. '/bin/python'
5757
end
58+
59+
venv_path = os.getenv("CONDA_PREFIX")
60+
if venv_path then
61+
if is_windows() then
62+
return venv_path .. '\\python.exe'
63+
end
64+
return venv_path .. '/bin/python'
65+
end
66+
5867
if M.resolve_python then
5968
assert(type(M.resolve_python) == "function", "resolve_python must be a function")
6069
return M.resolve_python()

0 commit comments

Comments
 (0)