Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E492: Not an editor command: ChatGPT #8

Open
vprokopev opened this issue Dec 7, 2022 · 9 comments
Open

E492: Not an editor command: ChatGPT #8

vprokopev opened this issue Dec 7, 2022 · 9 comments

Comments

@vprokopev
Copy link

I installed it with packer, same is in README file here. Got a prompt that it is installed successfully. But when I try to use it I get 'E492: Not an editor command: ChatGPT'.

@terror
Copy link
Owner

terror commented Dec 7, 2022

You may have to run :UpdateRemotePlugins, let me know if that works, I'll add it to the readme

@yingzhu146
Copy link

Thanks a lot for the amazing plugins @terror!

I have the same issue

I did :UpdateRemotePlugins, it created the rplugin file correctly

.local/share/nvim/rplugin.vim

containing

call remote#host#RegisterPlugin('python3', '/Users/yingzhu/.local/share/nvim/site/pack/packer/opt/chatgpt.nvim/rplugin/python3/chatgpt_nvim.py', [
      \ {'sync': v:false, 'name': 'ChatGPT', 'type': 'command', 'opts': {'nargs': '1'}},
     \ ])

I tried to manually source this file too, but get hit with a

E605: Exception not caught: Plugin "/Users/yingzhu/.local/share/nvim/site/pack/packer/opt/chatgpt.nvim/rplugin/python3/chatgpt_nvim.py" is already registered

So clearly it's loaded.

Nonetheless, get the 492.

maybe Important to note: I'm lazy loading on ChatGPT command via packer, but even if I manually force load it and do the above dance it doesn't work.

Thanks a lot for the help!

@kiil
Copy link

kiil commented Dec 9, 2022

I have the same issue. The plugin is loaded, but the ChatGPT command just returns:

E492: Ikke en editor-kommando: ChatGPT which translates to 'E492: Not an editor command: ChatGPT'.

@TheJoeSchr
Copy link

TheJoeSchr commented Dec 10, 2022

On arch linux this worked, plugin was installed via Plug 'terror/chatgpt.nvim', { 'do': 'pip install -r requirements.txt' }.

I created this file: ~/.local/share/nvim/rplugin.vim

call remote#host#RegisterPlugin('python3', '$HOME/.vim/plugged/chatgpt.nvim/rplugin/python3/chatgpt_nvim.py', [
      \ {'sync': v:false, 'name': 'ChatGPT', 'type': 'command', 'opts': {'nargs': '1'}},
     \ ])

observe the different path to .vim/plugged in comparion with @yingzhu146 post.

now :ChatGPT is active and autocompletes

@TheJoeSchr
Copy link

now I get this error

Encountered ImportError loading plugin at $HOME/.vim/plugged/chatgpt.nvim/rplugin/python3/chatgpt_nvim.py: No mo
dule named 'chatgpt_nvim'
Traceback (most recent call last):
  File "/home/joe/.py3nvim/lib/python3.10/site-packages/pynvim/plugin/host.py", line 164, in _load
    file, pathname, descr = find_module(name, [directory])
  File "/home/joe/.py3nvim/lib/python3.10/site-packages/pynvim/compat.py", line 30, in find_module
    return original_find_module(fullname, path)
  File "/usr/lib/python3.10/imp.py", line 297, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named 'chatgpt_nvim'

@TheJoeSchr
Copy link

After replacing $HOME with my absolute file path, I get

no notification handler registered for "/home/joe/.vim/plugged/chatgpt.nvim/rplugin/python3/chatgpt_nvim.py:comm
and:ChatGPT"
Encountered ModuleNotFoundError loading plugin at /home/joe/.vim/plugged/chatgpt.nvim/rplugin/python3/chatgpt_nv
im.py: No module named 'dotenv'
Traceback (most recent call last):
  File "/home/joe/.py3nvim/lib/python3.10/site-packages/pynvim/plugin/host.py", line 165, in _load
    module = imp.load_module(name, file, pathname, descr)
  File "/usr/lib/python3.10/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/usr/lib/python3.10/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 719, in _load
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
ModuleNotFoundError: No module named 'dotenv'

@TheJoeSchr
Copy link

So now I found out my python host path via
:let g:python3_host_prog => $PY_PATH
and then called it and installed the requirements again
$PY_PATH -m pip install -r ~/.vim/plugged/chatgpt.nvim/requirements.txt

now I can use :ChatGPT write me something without any ModuleNotFoundError

but I got an error about Notification not registered for ChatGPT plugin. I could "solve" this by actually opening an existing file :D

@marwuint
Copy link

i get sameE492: Not an editor command: ChatGPT. installed with packer, says plugin is loaded.

@pannet1
Copy link

pannet1 commented Dec 28, 2022

i have tried all steps mentioned by @TheJoeSchr but i still get the notification error

no notification handler registered for "/home/pannet1/.loc al/share/nvim/site/pack/packer/start/chatgpt.nvim/rplugin/ python3/chatgpt_nvim.py:command:ChatGPT"

i am on EOS a derivative of Arch LInux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants