
This show up every time I press a key in Oni.
Also on startup, Oni is just a blank ( black ) window and contents on screen wont appear until I enter command mode or insert mode. It seems like the issue only pops up when in normal mode.
nvim starts fine without any issue
I tried fixing the python path in config.js by setting the python path as received from the output of $ which python, but still the same issue.
This is my entire config file:
module.exports = {
"oni.useDefaultConfig": true,
"oni.loadInitVim": true,
"editor.fontSize": "14px",
"editor.fontFamily": "Monaco",
"editor.completions.enabled": true,
"neovim.global.python_host_prog": "/usr/local/bin/python3"
}
It throws the same even when I am not loading my neovim's init.vim config. I also tried setting the python path as the path of python2.
Also check out from this issue issue#649 and tried adding python path in Contents/Resources/app/vim/default/bundle/oni-vim-defaults/plugin/init.vim. Still no luck.
Hi @meain ,
Thanks for trying out Oni! Sorry you're hitting this, and I really appreciate the troubleshooting you've done so far.
Would you mind running Neovim in the terminal and running :CheckHealth, and sharing the output? There might be some clues there. It does seem that Oni is having an issue finding the python provider - that may give us some clues.
Also, if you completely remove your config.js, are you still hitting the issue?
@bryphe Python part of :CheckHealth, seems fine to me. Nvim finds it even without seting.
## Python 2 provider (optional)
- INFO: `g:python_host_prog` is not set. Searching for python2 in the environment.
- SUCCESS: pyenv found: "/usr/local/Cellar/pyenv/1.1.5/libexec/pyenv"
- WARNING: pyenv is not set up optimally.
- SUGGESTIONS:
- Create a virtualenv specifically for Neovim using pyenv, and set `g:python_host_prog`. This will avoid the need to install Neovim's Python module in each version/virtualenv.
- INFO: Executable: /Library/Frameworks/Python.framework/Versions/2.7/bin/python2
- INFO: Python2 version: 2.7.13
- INFO: python2-neovim version: 0.1.13
- SUCCESS: Latest python2-neovim is installed: 0.1.13
## Python 3 provider (optional)
- INFO: `g:python3_host_prog` is not set. Searching for python3 in the environment.
- SUCCESS: pyenv found: "/usr/local/Cellar/pyenv/1.1.5/libexec/pyenv"
- WARNING: pyenv is not set up optimally.
- SUGGESTIONS:
- Create a virtualenv specifically for Neovim using pyenv, and set `g:python3_host_prog`. This will avoid the need to install Neovim's Python module in each version/virtualenv.
- INFO: Executable: /usr/local/bin/python3
- INFO: Python3 version: 3.6.3
- INFO: python3-neovim version: 0.1.13
- SUCCESS: Latest python3-neovim is installed: 0.1.13
I had this issue even when I had no config.js
I'm also getting the same error. It seems to happen whenever the cursor moves (hjkl, o, O, etc). FWIW I managed to run HealthCheck in Oni and this is what I got:
health#nvim#check
========================================================================
## Configuration
- OK: no issues found
## Performance
- OK: Build type: Release
## Remote Plugins
- OK: Up to date
## terminal
- ERROR: command failed: infocmp -L
infocmp: environment variable TERM not set
- INFO: $XTERM_VERSION=''
- INFO: $VTE_VERSION=''
- INFO: $TERM_PROGRAM=''
- INFO: $COLORTERM=''
- INFO: $SSH_TTY=''
health#provider#check
========================================================================
## Clipboard (optional)
- OK: Clipboard tool found: pbcopy
## Python 2 provider (optional)
- WARNING: No Python interpreter was found with the neovim module. Using the first available for diagnostics.
- WARNING: provider/pythonx: Could not load Python 2:
python2 not found in search path or not executable.
/usr/bin/python2.7 does not have the "neovim" module. :help |provider-python|
/usr/bin/python2.6 does not have the "neovim" module. :help |provider-python|
/usr/bin/python does not have the "neovim" module. :help |provider-python|
- ERROR: Python provider error
- ADVICE:
- provider/pythonx: Could not load Python 2:
python2 not found in search path or not executable.
/usr/bin/python2.7 does not have the "neovim" module. :help |provider-python|
/usr/bin/python2.6 does not have the "neovim" module. :help |provider-python|
/usr/bin/python does not have the "neovim" module. :help |provider-python|
- INFO: Executable: Not found
## Python 3 provider (optional)
- INFO: Disabled. g:loaded_python3_provider=1
## Ruby provider (optional)
- INFO: Ruby: ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
- WARNING: Missing "neovim" gem.
- ADVICE:
- Run in shell: gem install neovim
- Is the gem bin directory in $PATH? Check `gem environment`.
- If you are using rvm/rbenv/chruby, try "rehashing".
I found a work-around. Seems like a problem with the PATH environment variable so Neovim can't find python3. Oni is executed with this value for PATH:
:echo $PATH
/usr/bin:/bin:/usr/sbin/sbin
so if you change it to include the path to python3 the problem goes away. In my case I just used this command from a terminal:
launchctl setenv PATH $PATH
And problem solved. Not sure what the long term solution should be though
Setting my env with launchctl did not work for me. I launched Oni from my shell with open -a "Oni" which worked.
@juancampa @hkrutzer Cool, both works for me! Thanks 馃憤
Awesome, thanks @juancampa and @hkrutzer for the extra info and the workaround! This helps a ton.
I believe PR #924 by @Akin909 will help this situation. It seems that, when launched outside the terminal (like from finder), we don't get the set of environment variables. This will allow setting the environment.additionalPaths variable here https://github.com/onivim/oni/wiki/Configuration#environment so that Oni can know which paths should be included when run outside the terminal environment. By default, we bring in /usr/local/bin, which looks like would catch some of these cases.
Later, it might be worth automating this as @Akin909 mentioned with a module like https://github.com/sindresorhus/shell-env - this would allow Oni to pull the environment variables directly from the terminal, even when opened from the dock or finder.
PR #924 is now available in release 0.2.17, which should fix this issue if the python executable is in /usr/local/bin.
I'll close this out, but let me know if you are still seeing issues. Thanks!
On the latest release, with the following on config I get the same error:
module.exports = {
"menu.caseSensitive": "smart",
"editor.scrollBar.visible": false,
"editor.cursorLine": false,
// "oni.useDefaultConfig": false,
"debug.incrementalRenderRegions": false,
"prototype.editor.backgroundOpacity": 1.0,
"prototype.editor.backgroundImageUrl": "",
"prototype.editor.backgroundImageSize": "cover",
// "oni.useDefaultConfig": true,
"experimental.autoClosingPairs.enabled": true,
"prototype.editor.maxCellsToRender": 12000,
"oni.loadInitVim": true,
"oni.hideMenu": true,
"editor.fontLigatures": false,
"editor.linePadding": 1,
"editor.fontSize": "14px",
"tabs.mode": "buffers",
"tabs.height": "2em",
"editor.quickInfo.enabled": false,
"editor.completions.enabled": false,
"editor.errors.slideOnFocus": false,
"editor.formatting.formatOnSwitchToNormalMode": false,
"editor.fontFamily": "PragmataPro",
"statusbar.enabled": false
}
It's only when I disable the default Oni config that it cannot find the neovim python plugins.
When running :CheckHealth from within Oni, I get:
## Python 2 provider (optional)
- INFO: Using: g:python_host_prog = "/usr/local/bin/python"
- INFO: Executable: /usr/bin/python
- ERROR: Command error (job=4): '/usr/bin/python' '-c' 'import neovim; print(neovim.__file__)'
Output: Traceback (most recent call last): File "<string>", line 1, in <module>ImportError: No module named neovim
- INFO: Python2 version: 2.7.10
- INFO: python-neovim version: unable to load neovim Python module
- ERROR: Neovim Python client is not installed.
Error: unable to load neovim Python module
- ADVICE:
- Run in shell: pip2 install neovim
## Python 3 provider (optional)
- INFO: Disabled. g:loaded_python3_provider=1
Thanks for all the info and troubleshooting, @jordwalke ! Really helpful.
Interesting - looks like it's picking up the python provider from the wrong place.
It'd be interesting to see what the $PATH looks like in Oni versus running Neovim from the terminal (we can check via :term and then echo $PATH.) I suspect that there is a pathing difference that is causing this - I bet it should be picking up python from /usr/local/bin instead of /usr/bin.
I think the PR #934 that @Akin909 is working on is the long-term fix here, as that will let us pick up the same $PATH used by the terminal.
We have this setting by default:
"environment.additionalPaths": [
"/usr/bin",
"/usr/local/bin",
],
...which is a band-aid until we can get the full set of paths. But it might be worth trying to reverse that to:
"environment.additionalPaths": [
"/usr/local/bin",
"/usr/bin",
],
to see if that grabs the 'right' python provider.
This should be fully addressed now with @Akin909 's fix in #1066 - I'll close it out, but let me know if there are still other issues here.