nvim-neotest / neotest-python

MIT License
132 stars 40 forks source link

module 'neotest-python' not found #77

Closed norpadon closed 2 months ago

norpadon commented 3 months ago

I am getting an error when trying to install it using Lazy:

{
  'nvim-neotest/neotest',
  dependencies = {
    'nvim-neotest/nvim-nio',
    'nvim-lua/plenary.nvim',
    'antoinemadec/FixCursorHold.nvim',
    'nvim-treesitter/nvim-treesitter',
  },
  config = function()
    require('neotest').setup {
      adapters = {
        require 'neotest-python' {
          dap = { justMyCode = false },
          args = { '--log-level', 'DEBUG' },
          runner = 'pytest',
          pytest_discover_instances = true,
        },
      },
    }
  end,
}

results in the following error

Failed to run `config` for neotest

/Users/norpadon/.config/nvim/lua/custom/plugins/neotest.lua:13: module 'neotest-python' not found:
^Ino field package.preload['neotest-python']
cache_loader: module neotest-python not found
cache_loader_lib: module neotest-python not found
^Ino file './neotest-python.lua'
^Ino file '/opt/homebrew/share/luajit-2.1/neotest-python.lua'
^Ino file '/usr/local/share/lua/5.1/neotest-python.lua'
^Ino file '/usr/local/share/lua/5.1/neotest-python/init.lua'
^Ino file '/opt/homebrew/share/lua/5.1/neotest-python.lua'
^Ino file '/opt/homebrew/share/lua/5.1/neotest-python/init.lua'
^Ino file './neotest-python.so'
^Ino file '/usr/local/lib/lua/5.1/neotest-python.so'
^Ino file '/opt/homebrew/lib/lua/5.1/neotest-python.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'

# stacktrace:
  - .config/nvim/lua/custom/plugins/neotest.lua:13 _in_ **config**
  - .config/nvim/init.lua:238
airreality commented 2 months ago

From neotest docs (https://github.com/nvim-neotest/neotest):

To get started you will also need to install an adapter for your test runner.

There is no neotest-python dependency in your config. Just add it:

  dependencies = {
    'nvim-neotest/nvim-nio',
    'nvim-lua/plenary.nvim',
    'antoinemadec/FixCursorHold.nvim',
    'nvim-treesitter/nvim-treesitter',
    'nvim-neotest/neotest-python',
  }