Skip to content

Doesn't utilize virtual environment #24

@theafox

Description

@theafox

Currently, jupytext.nvim does not utilize any virtual environment for the jupytext package, even if one is specified using the python3_host_prog option.

Steps to reproduce

  • Setup a virtual environment: python3 -m venv venv,
  • install jupytext in this environment (but not globally): venv/bin/python -m pip install pynvim jupytext,
  • run the minimal config given below: nvim -nu minimal.lua, and
  • run :checkhealth jupytext inside Neovim.

With the minimal setup minimal.lua like so:

vim.g.python3_host_prog = vim.fn.fnamemodify("./venv/bin/python3", ":p")

local root = vim.fn.fnamemodify("./.repro", ":p")
for _, name in ipairs({ "config", "data", "state", "cache" }) do
	vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
	vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)

local plugins = {
	{
		"GCBallesteros/jupytext.nvim",
		lazy = false,
		config = true,
	},
}
require("lazy").setup(plugins, { root = root .. "/plugins" })

Output of checkhealth

After executing the steps above the output of :checkhealth jupytext is as follows:

jupytext: require("jupytext.health").check()

jupytext.nvim ~
- ERROR Jupytext is not available
  - ADVICE:
    - Install jupytext via `pip install jupytext`

Expected behaviour

The local installation of jupytext inside the environment should be used.

More information

  • OS: macOS Sonoma 14.4.1
  • Neovim version:
    $ nvim --version
    NVIM v0.9.5
    Build type: Release
    LuaJIT 2.1.1710088188

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions