Open User1391 opened 1 year ago
How did you add the plugin to vim?
Using Plug
No idea what the issue is, maybe you could just reinstall it. If that doesn't work, please send me the exact Plug line, path of the installed plugin on the filesystem and the output of the ls -la *
command in that path.
I just ran into this issue as well, and uninstalling + reinstalling didn't fix it. I'm using vim-plug to install in the usual way, and I see that an error flashes across the installation screen when this happens (too quick for me to read). my macOS Vim installation seems to have python3 support,
$ vim --version | grep "+python"
+cmdline_info +libcall +python3 +virtualedit
but I'm also seeing that the plugin seems to look for the openai
installation in a way that is incompatible with pyenv
, i.e., I've just done pip install openai
, which installs the package in my "global" virtualenv -- not sure if this is related.
I guess https://github.com/tom-doerr/vim_codex/blob/main/plugin/vim_codex.vim#L20 is what's obviously failing but I'm not sure why
Could you try installing openai
in a virtualenv and running vim inside that?
@tom-doerr I faced the same problem. But it happens randomly. When I ask for an auto completion with "Ctrl+X" and then I continue asking again then it randomly appears and goes away if I give it a pause. I think it should be about handling some errors/statuses that the API returns.
Actually I have the same problem. I've just installed vim_codex, using the way specified in the documentation, so it is in my ~/.vim/bundle/vim_codex directory. Then I installed openai, and I have the same error.
In my case it seems there is a limitation on API calls and not related to NameError: name plugin is not defined
:
raise self.handle_error_response(
openai.error.RateLimitError: Rate limit reached for default-codex in organization org-xOr2p41SW53e8dvuSWUTdryJ on requests per min. Limit: 20.
000000 / min. Current: 30.000000 / min. Contact support@openai.com if you continue to have issues or if you’d like to request an increase. Ple
ase add a payment method to your account to increase your rate limit. Visit https://platform.openai.com/account/billing to add a payment metho
d.
Here is the error message when running CreateCompletion
Error detected while processing function CreateCompletion: Traceback (most recent call last): File "<string>", line 1, in <module> NameError: name 'plugin' is not defined