mfussenegger / nvim-dap-python

An extension for nvim-dap, providing default configurations for python and methods to debug individual test methods or classes.
GNU General Public License v3.0
492 stars 46 forks source link

python not found in virtual environment #133

Closed c30ra closed 3 months ago

c30ra commented 3 months ago

On Windows, it can't find the python executable, cause it searches for python3. On Windows, usually there is no python3 executable installed.

I've temporary fixed it by rename the python executable from python.exe to python3.exe.

I'm doing something wrong or nvim-dap-python really expect a python3.exe on Windows??

mfussenegger commented 3 months ago

It doesn't look for a python3.exe

https://github.com/mfussenegger/nvim-dap-python/blob/66560f0ebddf96604f7037e1efad3ba6942761e6/lua/dap-python.lua#L55

https://github.com/mfussenegger/nvim-dap-python/blob/66560f0ebddf96604f7037e1efad3ba6942761e6/lua/dap-python.lua#L91

c30ra commented 3 months ago

Thanks for the the quick reply! Once I'm back home I'll double check my configuration. Today I managed to make it work only by renaming the executable. The error it gave me was something like: ENOENT: python3 file not found or something similar..

c30ra commented 3 months ago

I confirm that there is nothing on my nvim config that set python3

mfussenegger commented 3 months ago

Well, the only other python3 occurrance is for the python that's used to run the debugpy adapter itself, which you can configure with the setup method.

See https://github.com/mfussenegger/nvim-dap-python/blob/66560f0ebddf96604f7037e1efad3ba6942761e6/lua/dap-python.lua#L182

Otherwise it has to come from your configuration.