Comments (5)
The default pythonPath
fall back to the virtualenv where debugpy
is installed.
Here I just override it to ignore that path.
function()
local dap_install = require "dap-install"
local dbg_list = require("dap-install.api.debuggers").get_installed_debuggers()
local overrides = {
python = {
adapters = {
type = "executable",
command = "python3",
args = { "-m", "debugpy.adapter" },
},
configurations = {
{
type = "python",
request = "launch",
name = "Launch file",
program = "${file}",
pythonPath = function()
local venv_path = os.getenv "VIRTUAL_ENV"
if venv_path then
local util_sys = require "dap-install.utils.sys"
if util_sys.is_windows() then
return venv_path .. "\\Scripts\\python.exe"
end
return venv_path .. "/bin/python"
end
local cwd = vim.fn.getcwd()
if vim.fn.executable(cwd .. "/venv/bin/python") == 1 then
return cwd .. "/venv/bin/python"
elseif vim.fn.executable(cwd .. "/.venv/bin/python") == 1 then
return cwd .. "/.venv/bin/python"
else
return "/usr/bin/python3"
end
end,
},
},
},
}
for _, debugger in ipairs(dbg_list) do
dap_install.config(debugger, overrides[debugger])
end
end
from dap-buddy.nvim.
What kind of dependencies are we talking about? Could you elaborate?
from dap-buddy.nvim.
For example, I have the package CloudFlare
installed by the package manager. However, the debugpy
could not find it as debugpy
is installed in virtualenv. So when I start debugging, it complains about the missing packages.
from dap-buddy.nvim.
Solved by overriding the pythonPath
function
from dap-buddy.nvim.
Hey @meijieru! do you mind sharing what you changed it to? Perhaps we could make a FAQ
out of this.
from dap-buddy.nvim.
Related Issues (20)
- Typescript is not supported for nodejs HOT 3
- Synchronous adapter installation HOT 1
- `ccppr_lldb` insists I do not need to install it HOT 1
- how to use iwth rust-tools.nvim?
- Error occur in using codelldb
- cannot step_into python library code [justMyCode option maybe] HOT 1
- DIInstall crashes nvim
- `:DIInstall ccppr_vsc` complains wget is missing URL HOT 4
- How do you actually run the debugger 😅 HOT 3
- nodejs configuration is not working
- No configuration found for 'c'
- Bash debugger implementation discussion
- Multi-install debuggers 🦆🦆🦆🦆
- require "dap_install" doesn't find anything HOT 3
- Add firefox debugger
- Migration from DAPInstall.nvim HOT 12
- Can not find the dependencies. HOT 2
- Beginner's documentation needed HOT 2
- attempt to index field 'info_window' (a nil value)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dap-buddy.nvim.