Skip to content

NotImplementedError: ImageGrab.grabclipboard() is macOS and Windows only #3

@oxio2

Description

@oxio2

My img-paste.lua config file inside lazyvim configs

return {
  -- add symbols-outline
  {
    "TobinPalmer/pastify.nvim",
    config = function()
      require("pastify").setup({
        opts = {
          absolute_path = false, -- use absolute or relative path to the working directory
          apikey = "", -- Api key, required for online saving
          local_path = "/assets/imgs/", -- The path to put local files in, ex ~/Projects/<name>/assets/images/<imgname>.png
          save = "local", -- Either 'local' or 'online'
        },
        ft = { -- Custom snippets for different filetypes, will replace $IMG$ with the image url
          html = '<img src="$IMG$" alt="">',
          markdown = "![]($IMG$)",
          tex = [[\includegraphics[width=\linewidth]{$IMG$}]],
        },
      })
    end,
  },
}

Error message when executing the command :Pastify

Error invoking 'python_execute' on channel 3 (python3-script-host):
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/oxio2/.local/share/nvim/lazy/pastify.nvim/python3/pastify/main.py", line 30, in paste_text
    img = ImageGrab.grabclipboard()
  File "/usr/lib/python3/dist-packages/PIL/ImageGrab.py", line 120, in grabclipboard
    raise NotImplementedError("ImageGrab.grabclipboard() is macOS and Windows only")
NotImplementedError: ImageGrab.grabclipboard() is macOS and Windows only

NotImplementedError: ImageGrab.grabclipboard() is macOS and Windows only

It looks like the functionality only works on macOS and Windows, is this an error associated with my machine/configs or does the plugin not support linux at all? If this is the case, will the plugin support linux in the future?

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