Open jakebrinkmann opened 4 years ago
@incoggnito can you help me with this one, please?
On Ubuntu, you can define the default version of Python that is being used, and the path for the binary, using update alternative
. For instance, to set Python 3.8.5 as the default interpreter when typing python at the prompt, run (as root):
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8.5 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7.1 2
The number you put at the rightmost position defines the priority of a specific version of Python if you have multiple versions installed on your OS. You can query the defaults using sudo update-alternatives --config python
. Usually, a single symlink /usr/bin/python3 -> /usr/bin/python
should do the trick, though, or you can use some convenience package.
An alternative for @kassio would be to rely on python3_host_prog
, instead of plain hard coded executable('python')
, provided it is defined using let g:python3_host_prog = '/usr/bin/python3'
in (neo)vim init file, as expected.
Hope that helps.
Still have this issue after a fresh install.
vim: neovim 0.6.1
OS: Windows
- Opened a neoterm with
:Ttoggle
- Try to send line to terminal
:TREPLSendLine
- See
E121: Undefined variable: g:neoterm_repl_command
- See
E116: Invalid arguments for function join(g:neoterm_repl_command) =~# 'ipython'
I'm using conda
env, but the error exists even in base
environment.
Describe the bug Ubuntu doesn't ship with
python
anymore, but ships withpython3
so the checkis_valid
which evaluatesexecutable('python')
should possibly includeexecutable('python3')
or something.... (I think the wayis_valid
is handled is not very clear, although maybe it's the simplest way).is_valid
: https://github.com/kassio/neoterm/blob/8a3a0fb0977d89b2f3533246f3238c0f48173e2e/ftdetect/set_repl_cmd.vim#L13executable
: https://github.com/kassio/neoterm/blob/018f66204223336f74c0c5d2952a270e7bffc330/autoload/neoterm/repl/python.vim#L13To Reproduce Steps to reproduce the behavior:
python
is not installed, butpython3
is:Ttoggle
:TREPLSendLine
E121: Undefined variable: g:neoterm_repl_command
E116: Invalid arguments for function join(g:neoterm_repl_command) =~# 'ipython'
Expected behavior Configuration according to https://github.com/kassio/neoterm/blob/master/doc/neoterm.txt#L272 should allow me to execute code in a REPL.
Screenshots/gifs N/A
Versions (Issues without this information will take longer to be answered/solved):
Ubuntu 20.04.1 LTS
807a94f746bac2ab328dc22e6ca88bd411283cc8
let g:neoterm_repl_python = \ ['source .virtualenv/bin/activate', 'python']
" This makes it "work": let g:neoterm_repl_command = add(g:neoterm_repl_python, '')