n0v1c3 / vira

Create and update your Jira issues while inside Vim!
MIT License
95 stars 12 forks source link

NameError: name 'Vira' is not defined #43

Closed uberbrodt closed 3 years ago

uberbrodt commented 4 years ago

Followed README, but getting this when running :ViraServers:

Error detected while processing function vira#_menu[42]..provider#python3#Call:                                                                                                                                                                                                                                                                             
line   18:                                                                                                                                                                                                                                                                                                                                                  
Error invoking 'python_execute' on channel 4 (python3-script-host):                                                                                                                                                                                                                                                                                         
Traceback (most recent call last):                                                                                                                                                                                                                                                                                                                          
  File "<string>", line 1, in <module>                                                                                                                                                                                                                                                                                                                      
NameError: name 'Vira' is not defined        

output of :version

:version                                                                                                                                                                                                                                                                                                                                                    NVIM v0.4.4                                                                                                                                                                                                                                                                                                                                                 Build type: RelWithDebInfo                                                                                                                                                                                                                                                                                                                                  
LuaJIT 2.1.0-beta3                                                                                                                                                                                                                                                                                                                                          
Compilation: /usr/bin/cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fc
f-protection -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=1 -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE
 -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/builddir/build/BUILD/neovim-0.4.4/build/config -I/builddir/build/BUILD/neovim-0.4.4/src -I/usr/include -I/usr/include/lua-5.1 -I/builddir/build/BUILD/neovim-0.4.4/build/src/nvim/auto -I/builddir/build/BUILD/neovim-0.4.4/build/include                                                          
Compiled by mockbuild                                                                                                                                                                                                                                                                                                                                       

Features: +acl +iconv +tui                                                                                                                                                                                                                                                                                                                                  
See ":help feature-compile"                                                                                                                                                                                                                                                                                                                                 

   system vimrc file: "$VIM/sysinit.vim"                                                                                                                                                                                                                                                                                                                    
  fall-back for $VIM: "/usr/share/nvim"                                                                                                                                                                                                                                                                                                                     

Run :checkhealth for more info                                                                                                                                                                                                                                                                                                                              
Press ENTER or type command to continue              

python3 output from healthcheck

## Python 3 provider (optional)
  - INFO: pyenv: Path: /home/cbrodt/lib/pyenv/libexec/pyenv
  - INFO: pyenv: Root: /home/cbrodt/lib/pyenv
  - INFO: Using: g:python3_host_prog = "/home/cbrodt/lib/pyenv/versions/python_neovim3/bin/python"
  - INFO: Executable: /home/cbrodt/lib/pyenv/versions/python_neovim3/bin/python
  - INFO: Python version: 3.8.3
  - INFO: pynvim version: 0.4.1
  - OK: Latest pynvim is installed.
n0v1c3 commented 4 years ago

@uberbrodt Thank you for letting us know along with the information.

I will have a real look at the issue, I just happen to be getting ready to be going home so I will be on it when I actually get a chance.

ijsong commented 4 years ago

@uberbrodt If you are using nvim, check pynvim. https://github.com/neovim/pynvim

n0v1c3 commented 4 years ago

@uberbrodt pip install --user pynvim OR pip3 install --user pynvim (this was required in another issue over pip claimed due to nvim)

I have not had a real chance to test your issue but @ijsong reminded me of another issue we had.

n0v1c3 commented 4 years ago

@uberbrodt I am assuming pynvim was not the true core of the issue. I am curious if it is only neovim or if vim is also capable of producing the same issue. The closest I was able to get is having a missing characters in my vira_servers file. Are you using the json or the yaml file?

uberbrodt commented 4 years ago

Sorry got caught up in some other work. I'll take a look later tonight

On Mon, Aug 24, 2020, 17:49 Travis Gall notifications@github.com wrote:

@uberbrodt https://github.com/uberbrodt I am assuming pynvim was not the true core of the issue. I am curious if it is only neovim or if vim is also capable of producing the same issue. The closest I was able to get is having a missing characters in my vira_servers file. Are you using the json or the yaml file?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/n0v1c3/vira/issues/43#issuecomment-679404999, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHO3IZZHJ44MKSZMAR3KSDSCLU77ANCNFSM4QFITQ2A .

n0v1c3 commented 4 years ago

No worries. I am simply interested in making it as easy as possible for everyone to set up. I currently only have an open issue with nVim mentioned and that is simply an update to the README to show that it is supported. 😓 I will now need to add the link to this github issue to that issue as a requirement to call it complete.

uberbrodt commented 4 years ago

I tried upgrading pynvim, but looks like 0.4.1 is the latest version. I double checked the servers config and it looks like valid JSON to me and to a JSON linter I installed. I haven't tried VIM, though I suppose I could. What platforms do you test against?

n0v1c3 commented 4 years ago

Currently most of my testing is in the Linux world (Arch Linux), we did have some OSx issues not too long ago but it was for the BROWSER and there was a pull request that fixed that one. I am doing the testing on Vim and NVim but do admit that I am in Vim the most. Windows may be falling behind in the testing but it was working in the past...

I did see a small change in version of nVim (community/neovim) for my initial tests (0.4.4-1) on this and I have also pushed it up to v0.5.0 (aur/neovim-git). Vim I am using 8.1. Our Python 3 looks the same other than paths. I do wonder if the path for python affects us as my executable is /usr/bin/python3.

Otherwise, LuaJIT I am using only 2.0.5 but I do not believe that should affect us at all.

uberbrodt commented 4 years ago

I'm running Fedora, so definitely seems like this should work...I do set the g:python3_host_prog variable so that I can use a particular Pyenv, so that might be the issue? I'll try unsetting it and see if that helps

n0v1c3 commented 4 years ago

@uberbrodt looking if you have had a try I will need to set up a test for that myself.

The only thing I have come across so far, this was in the help files:

Must be set before any check for has("python3")

I did not see this in my local help but on the online one. I also assume this "should" not be the issue.

zamboney commented 4 years ago

i had the same problem and it's turn out that i didn't configure the ~/.config/vira/vira_servers.json. @uberbrodt try to check if your vira_servers.json file is set

n0v1c3 commented 4 years ago

We have an issue for that one, if vira_servers.json/yaml doesn't exist then ask for manual entry. I will move it up into the next release. I do believe @uberbrodt has a server file set up but still worth having the manual entry or at least a clean message to config your server.

@zamboney thanks for the further update.

n0v1c3 commented 4 years ago

@uberbrodt I am curious if you are using pass as we do also have one bug that shows up when multiple lines are in your pass. If you do try a direct password entry as this is also on the next release plan.

uberbrodt commented 4 years ago

Ok, so I finally got back around to looking at this. I tested with removing the python3_host_prog and it worked after I upgraded to pynvim 0.4.2 (previous was at 0.4.1).

Setting the python3_host_prog again and then manually install the jira package works as well. My suspicion is that the automatic install via vim-plug was not working with virtualenv for some reason, so might be something to note in the README. Thanks to everyone for debugging and offering advice!

n0v1c3 commented 4 years ago

I will keep this open as I create a new issue for virtualenv testing along with updating the README.

Thanks for the testing, feedback and most of the work. I see another issue up already but please keep them coming as this is the way to make it work better for more of us.