question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

force_py_version to python2 does not work on Ubuntu 16.10

See original GitHub issue

Issue

I’ve added let g:jedi#force_py_version = 2 to my .vimrc. This yields the error message:

Error detected while processing function jedi#init_python: line 7: Error: jedi-vim failed to initialize Python: Could not setup g:jedi#force_py_ver sion: jedi#setup_py_version: Vim(pyfile):E319: Sorry, the command is not availab le in this version: pyfile /home/kms/.vim/bundle/jedi-vim/initialize.py (in func tion jedi#init_python[3]…<SNR>33_init_python, line 6) Error detected while processing function jedi#init_python[3]…<SNR>33_init_pytho n[4]…jedi#force_py_version[2]…jedi#setup_py_version: line 14: E319: Sorry, the command is not available in this version: pyfile /home/kms/.vim /bundle/jedi-vim/initialize.py

Steps to reproduce

  1. Install Ubuntu 16.10
  2. Install jedi-vim
  3. add let g:jedi#force_py_version = 2 to your .vimrc
  4. open a python file and see error message

Versions

  • jedi-vim: [master] 0.8.0-47-ge66c2e1
  • Vim / Neovim: 7.4.1829
  • Python: 2.7.12+

In case you are not using jedi-vim from Git master, please test it there, too.

Output of the “JediDebugInfo” command (in a Python buffer)

Output of the “messages” Vim command

Error detected while processing function jedi#init_python: line 7: Error: jedi-vim failed to initialize Python: Could not setup g:jedi#force_py_ver sion: jedi#setup_py_version: Vim(pyfile):E319: Sorry, the command is not availab le in this version: pyfile /home/kms/.vim/bundle/jedi-vim/initialize.py (in func tion jedi#init_python[3]…<SNR>33_init_python, line 6) Error detected while processing function jedi#init_python[3]…<SNR>33_init_pytho n[4]…jedi#force_py_version[2]…jedi#setup_py_version: line 14: E319: Sorry, the command is not available in this version: pyfile /home/kms/.vim /bundle/jedi-vim/initialize.py

Output of “scriptnames” Vim command

1: /usr/share/vim/vimrc 2: /usr/share/vim/vim74/debian.vim 3: /usr/share/vim/vim74/syntax/syntax.vim 4: /usr/share/vim/vim74/syntax/synload.vim 5: /usr/share/vim/vim74/syntax/syncolor.vim 6: /usr/share/vim/vim74/filetype.vim 7: ~/.vimrc 8: /usr/share/vim/vim74/ftoff.vim 9: ~/.vim/bundle/Vundle.vim/autoload/vundle.vim 10: ~/.vim/bundle/Vundle.vim/autoload/vundle/config.vim 11: /usr/share/vim/vim74/ftplugin.vim 12: /usr/share/vim/vim74/indent.vim 13: /usr/share/vim/vim74/indoff.vim 14: /usr/share/vim/vim74/syntax/nosyntax.vim 15: ~/.vim/colors/Dark2_kms.vim 16: ~/.vim/bundle/supertab/plugin/supertab.vim 17: ~/.vim/bundle/csapprox/plugin/CSApprox.vim 18: ~/.vim/bundle/jedi-vim/plugin/jedi.vim 19: /usr/share/vim/vim74/plugin/getscriptPlugin.vim 20: /usr/share/vim/vim74/plugin/gzip.vim 21: /usr/share/vim/vim74/plugin/logiPat.vim 22: /usr/share/vim/vim74/plugin/manpager.vim 23: /usr/share/vim/vim74/plugin/matchparen.vim 24: /usr/share/vim/vim74/plugin/netrwPlugin.vim 25: /usr/share/vim/vim74/plugin/rrhelper.vim 26: /usr/share/vim/vim74/plugin/spellfile.vim 27: /usr/share/vim/vim74/plugin/tarPlugin.vim 28: /usr/share/vim/vim74/plugin/tohtml.vim 29: /usr/share/vim/vim74/plugin/vimballPlugin.vim 30: /usr/share/vim/vim74/plugin/zipPlugin.vim 31: ~/.vim/bundle/csapprox/after/plugin/CSApprox.vim 32: ~/.vim/bundle/jedi-vim/ftplugin/python/jedi.vim 33: ~/.vim/bundle/jedi-vim/autoload/jedi.vim 34: ~/.vim/bundle/SimpylFold/ftplugin/python/SimpylFold.vim 35: /usr/share/vim/vim74/ftplugin/python.vim 36: ~/.vim/bundle/jedi-vim/after/ftplugin/python/jedi.vim 37: /usr/share/vim/vim74/syntax/python.vim 38: ~/.vim/bundle/jedi-vim/after/syntax/python.vim

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
thekswensoncommented, Oct 31, 2016

This was the issue. One must install vim-gnome-py2 rather than the Ubuntu default vim-gnome.

0reactions
thekswensoncommented, Dec 4, 2017

I found a way to use the 17.04 packages with 17.10 from pi-rho: https://askubuntu.com/a/982986/14747.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ubuntu 16: Confusion regarding Python 2.7 and Python 3.x
Try to run the following: pip --version. Here is the output I get. Notice Python version mentioned within parenthesis.
Read more >
Unable to set default python version to python3 in ubuntu
but I'm getting the following error for the second statement, rejeesh@rejeesh-Vostro-1015:~$ update-alternatives --install /usr/bin/python python /usr/ ...
Read more >
How to install and switch between different python versions in ...
How to install and switch between different python versions in ubuntu 16.04. When I work with python, sometimes I face some issues with...
Read more >
Sunsetting Python 2
If people find catastrophic security problems in Python 2, or in software written in Python 2, then most volunteers will not help fix...
Read more >
pipenv Documentation - manpages.ubuntu!
NOTE: If you're newcomer and you get an error like this: >>> python Traceback ... While pip can install Python packages, Pipenv is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found