Oni: Can't use Oni b/c of Python in non-standard path

Created on 22 Aug 2017  路  6Comments  路  Source: onivim/oni

I've just loaded Oni and I wanted to edit the settings but I can't. I get flooded with the messages from the screenshot on every interaction I try, essentially putting Oni in gridlock.

screen shot 2017-08-22 at 23 03 52

The reason this seems to happen is b/c Oni needs Python but my Pythons are in a non-standard place because I maintain a separate virtual env for my editor Python. In neovim I account for that by setting g:python_host_prog and g:python3_host_prog to the right locations, but that setting isn't exposed by Oni. Though I can make Oni read my .config/nvim/init.vim that'll probably break a lot more due to the amount of customisation in there.

Since Oni appears to require Python to function I think those options should be configurable (and the absence of it handled slightly more elegantly). Alternatively, Python could be bundled?

bug help wanted

All 6 comments

Hi @daenney ,

Thanks for posting the issue! Ya, that does not look very usable 馃槮

Just curious - what platform and neovim version are you using? Oni actually shouldn't require Python to run. I'm wondering what the output of --version is.

Being able to specify g:python_host_prog and g:python3_host_prog from the Oni config is a good suggestion - that could at least help mitigate this issue.

I'm on macOS High Sierra (developer beta 7) running on top of NeoVim 0.2.0 from Homebrew.

NVIM v0.2.0
Build type: Release
Compilation: /Users/daenney/homebrew/Library/Homebrew/shims/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNDEBUG -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -I/tmp/neovim-20170730-70348-1ucpbic/neovim-0.2.0/build/config -I/tmp/neovim-20170730-70348-1ucpbic/neovim-0.2.0/src -I/Users/daenney/homebrew/include -I/Users/daenney/homebrew/include -I/Users/daenney/homebrew/include -I/Users/daenney/homebrew/include -I/Users/daenney/homebrew/include -I/Users/daenney/homebrew/include -I/Users/daenney/homebrew/opt/gettext/include -I/usr/include -I/tmp/neovim-20170730-70348-1ucpbic/neovim-0.2.0/build/src/nvim/auto -I/tmp/neovim-20170730-70348-1ucpbic/neovim-0.2.0/build/include
Compiled by [email protected]

Optional features included (+) or not (-): +acl   +iconv    +jemalloc +tui
For differences from Vim, see :help vim-differences

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/Users/daenney/homebrew/Cellar/neovim/0.2.0_1/share/nvim
"

If Oni doesn't require Python, any idea why this shows up?

Interesting... I just tried Oni on my Mac (Sierra 10.12.5), and ran :CheckHealth to make sure I wasn't loading python, and I don't have a python provider registered. It _is_ able to find Python 2.7, though (just not the module).

As a temporary measure, to check if this is the issue, could you please try setting g:python_host_prog in /Contents/Resources/app/vim/default/bundle/oni-vim-defaults/plugin/init.vim? This is the file that has an initial init.vim for Oni. This will just help validate that this is the root cause (and hopefully allow you to try Oni).

Making the change you suggested to init.vim fixes it, so it does seem that it needs to at least be able to find a Python executable.

health#nvim#check
========================================================================
## Configuration
  - SUCCESS: no issues found

## Performance
  - SUCCESS: Build type: RelWithDebInfo

## Remote Plugins
  - SUCCESS: Up to date

## terminal
  - ERROR: command failed: infocmp -L
    infocmp: environment variable TERM not set

health#provider#check
========================================================================
## Clipboard (optional)
  - SUCCESS: Clipboard tool found: pbcopy

## Python 2 provider (optional)
  - INFO: Using: g:python_host_prog = "/Users/daenney/.virtualenv/neovim-python2/bin/python2"
  - INFO: Executable: /Users/daenney/.virtualenv/neovim-python2/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: Using: g:python3_host_prog = "/Users/daenney/.virtualenv/neovim-python3/bin/python3"
  - INFO: Executable: /Users/daenney/.virtualenv/neovim-python3/bin/python3
  - INFO: Python3 version: 3.6.1
  - INFO: python3-neovim version: 0.1.13
  - SUCCESS: Latest python3-neovim is installed: 0.1.13

Thanks for making that tweak and confirming, @daenney ! I'll leave this open to track adding the g:python_host_prog and g:python3_host_prog variables as configuration settings in Oni.

It'd be nice to have a general solution for this, like:

"neovim.global.python_host_prog": "~/non-standard-python-path",

(Basically, have a way to assign any global configuration values directly in the Oni config). This is touched on some in #33 too

That would be awesome. Thanks for looking into it. In the mean time, I can now try Oni 馃榾

Was this page helpful?
0 / 5 - 0 ratings