vim-jedi autocomplete not working - python

I just installed jedi-vim with vundle
My vim version is 7.3.429.
I installed jedi vi pip
every time I hit . or <C-Space> I get this error.
Omni completion (^O^N^P) Pattern not found
when I searched here for this pattern I found a solution to use vim-jedi instead. But unfortunatelly this occours with jedi-vim.
Here is some output of some registers:
:set omnifunc
omnifunc=jedi#complete
:messages
Messages maintainer: Bram Moolenaar <Bram#vim.org>
"models.py" 31L, 1052C
<emptyline>

Because this line was in my .vimrc:
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
I could not use jedi for a long time. When removed it, it's OK.
:set omnifunc
omnifunc=jedi#completions

IIRC, jedi-vim was publicly released one or two weeks ago. I doubt you will get much help outside of its issue tracker.
Anyway, the plugin seems to be using Vim's omni completion under the hood, specifically the <C-x><C-o> shortcut which, in your case, doesn't seem to return anything because it can't recognize the keyword before the ..
Either jedi-vim doesn't work or your code is wrong or the plugin is badly installed.

Related

Visual Studio Code syntax highlighting not working

I am using Visual Studio Code (VSC) as my IDE. My computer just updated to Catalina 10.15.2 (19C57) and since the update, now VSC is not highlighting syntax errors. The extensions I have seem to be working and it recognizes my miniconda python environment.
Is there a solution for this yet? I was avoiding Catalina as I know it has caused lots of errors, but now that I was forced to install it I need a solution as I love VSC.
I also had the same problem for typescript react files. Tried many things and nothing worked. Finally I checked the extensions I've installed for typescript react. Disabling JavaScript and TypeScript Nightly extension worked for me
In my case, the Catalina installation didn't remove my Python installation.
After checking as suggested by #Brett Cannon in his comment, the update to Catalina uninstalled some extensions from VS Code. These are not available in the VS Code extension Marketplace anymore, so there must be an issue regarding compatibility. I fixed it after I opened my command palette (Command + Shift + p) and typed python: select linter. Then selected pylint, selected the install with conda option, Close/Open VS Code and now it's working(though it's still not shown in my extensions section in VS Code). It's necessary to point out that you will have to install pylint in every Python environment you are using. In my case I have multiple Conda environments.
It's very specific but for me it was a missing semicolon in my css (styled-component). I use styled-components in react and it didn't throw an error for missing semicolon but highlighting was suddenly gone.
I had given up and left it that way until I came up with the solution quite by accident.
If you were using the global install of Python then that was removed in Catalina which would break your virtual environment. A new install of Python and recreating the virtual environment should fix things.
Had similar issue on new vscode setup - my problem was rather that eslint warnings are not being highlighted, only errors.
After opening my eslint setup for the project - .eslintrc.js file, saw message saying that eslint needed permission accessing some files, which I did by clicking the lightbulb next to module.exports and hitting accept button.

eric6 can't compile in Python form (could not start pyuic5.exe)

I am trying to create a GUI using eric6 for a Python script I coded recently, however when I right click in eric6 on the new *.ui file I create and I try to compile it (choosing 'Compile Form'), the following error is displayed - could not start puyic5.exe:
I have tried the (very few) online solutions but without any luck (for example, checking that in the pyuic5.bat file, the mentioned directory is without any space, and also tried to re-install Qt5). Furthermore, even though both Python and PyQt are correctly installed, pyuic5.exe is missing in the directory specified in the error. Also, everything seems setup ok in the PATH in the system environmental variables.
Versions info:
Python 3.4.5
Qt 5.4.1
PyQt 5.4.1
eric6 17.06
EDIT: if it can help debugging my issue, I would like to add that if I open a command prompt and I invoke pyuic5 mainform.ui -o mainform.py it works without problems. Instead, in eric6, such error message is generated.
Thank you in advance for any precious help and guidance you may offer !
Sincerely,
Paolo
Solved downgrading to an older version of eric6 (precisely to v 17.04.1). Thought it might be useful to share in case somebody encounters the same problem.

Installing jedi-vim fails: vim says wrongly that +python is not compiled

I am trying to install jedi-vim. I am doing this at work - so I have to use gVim in Windows. I have already read several other posts in this forum. This has somehow made me smarter but still does not solve my problem.
I did the following things:
installed Pathogen
cloned jedi vim from https://github.com/davidhalter/jedi-vim.git and copied it to the bundle/ folder in the vim-dir.
Now, when I open a *.py-file vim always tells me
jedi-vim requires vim compiled with +python
but ':version' tells me that it's compiled with +python/dyn and +python3/dyn.
So what is the problem?
Additional infos:
vim version: 7.4
When I use ctrl+space to autocomplete a python key word, it tells me:
Error detected while processing function jedi#completions: line 1: E492: Not an editor command: Python jedi_vim.completions()
Error detected while processing function jedi#completions: line 1: E492: Not an editor command: Python jedi_vim.completions()
Press ENTER or type command to continue
I'm not sure if your are still experiencing the same issue, but after looking around I found this blog post that solved the problem for me. Essentially, it's just about re-installing vim (don't delete any config files) and then reinstalling from the source at the vim mercurial repo with the right flags. There might be a shorter/simpler version of doing this, but after trying back and forth many solutions, this one was the only one that worked:
Compiling Vim with Python and Ruby support on Ubuntu
These are the steps:
Check if Vim is compiled with Python:
$ vim --version | ack '(python)'
Remove Vim version installed:
$ sudo apt-get remove vim-common vim-runtime
Install dependencies needed to compile Vim:
$ sudo apt-get build-dep vim
Clone Vim repository, compile it and install the new version:
$ hg clone https://vim.googlecode.com/hg/ vim
$ cd vim
$ ./configure --enable-pythoninterp
$ make
$ sudo make install
+python/dyn means that Python support isn't statically compiled it, it's loaded dynamically when needed at runtime.
This is described in the python-dynamic help section:
On MS-Windows the Python library can be loaded dynamically. The |:version| output then includes |+python/dyn|.
This means that Vim will search for the Python DLL file only when needed.
When you don't use the Python interface you don't need it, thus you can use
Vim without this DLL file.
To use the Python interface the Python DLL must be in your search path. In a console window type "path" to see what directories are used.
The name of the DLL must match the Python version Vim was compiled with.
Currently the name is "python24.dll". That is for Python 2.4. To know for
sure edit "gvim.exe" and search for "python\d*.dll\c".
(Don't worry about the 2.4 there; I just happened to find docs from a few years ago. Read the help in your own copy of vim—or, better, do what the last paragraph says.)
So, either you don't have Python, you have the wrong version of Python, it's not on your %PATH%, vim is searching for it incorrectly, or it's failing to load.
At that time the problem was another one. I mixed up the architectures for vim and python - I used vim64Bit, but pyhton for 32bit.
I repaired that already some time ago but the other day I had to restart my computer and do some microsoft-Updates.
Unfortunately my vim (7.4) was totally broken. I had to re-set my home-dir. Then at least my vimrc was accessible again, but still my jedi in vim does not work.
Python is available in vim but still jedi does not seem to load correctly.
When I type "len(" in the beginning of a .py-file, at the place where arguments should be explained there are some strange characters, similar to this:
==jedi=0, == (_object_*) ==jedi==
When I type "self.", it says "unknown function: pythoncomplete#Complete"
I think it's only a configuration-issue, because it worked before the reboot.
Jedi is installed systemwide (with pip). If I try to install it "again", pip says that jedi is already installed.
I would appreciate your help very much ;-)

How do I integrate Pylint with Geany so that I can use Geany as a python IDE?

http://michaeljaylissner.com/blog/using-pylint-in-geany#comments
This blog says to set build command as
pylint -r no "%f"
and set a custom error regex
(W|E|F):([0-9]+):(.*)
The commenter suggests that with command
PYTHONPATH=${PYTHONPATH}:$(dirname %d) pylint --output-format=parseable --reports=n "%f"
that it is possible to click on a line number in log and be brought there by geany. I tried this and it has not worked for me.
In my project file, I have added
[build_settings]
error_regex=^(W|E|F):([0-9]+):(.*)
After reloading the file, same result. Am I setting the error_regex correctly? Why doesnt this work?
I'm the commenter on the blog post you cite.
I'm using a Debian-based system at the moment (Linux Mint Debian, to be precise), and using Geany 0.20. What I have is a file named filetypes.python in ~/.config/geany/filedefs which contains this:
[build-menu]
FT_00_LB=pep8
FT_00_CM=pep8 --repeat --count "%f"
FT_00_WD=
FT_01_LB=PyLint (basic)
FT_01_CM=PYTHONPATH=${PYTHONPATH}:"%d" pylint --output-format=parseable --reports=n --errors-only "%f"
FT_01_WD=
FT_02_LB=PyLint (full)
FT_02_CM=PYTHONPATH=${PYTHONPATH}:"%d" pylint --output-format=parseable "%f"
FT_02_WD=
error_regex=^([^:]+?):([0-9]+):.+
Note that the key difference between my setup and the blog post is that i'm using --output-format=pareseable, and my error_regex is a little less pylint-specific, so that it will work for pep8 too.
The PYTHONPATH=${PYTHONPATH}:"%d" bit is to add the current working directory to my custom python path, and I guess, off the top of my head, it won't work like that on Windows, so if you're on Windows you'll certainly need to modify (or drop) that bit. In fact, if you're on Windows, please indicate that, as there might be a few bits that need changing.
I have written a plugin which checks your code with pep8 pylint and pyflakes the code is available on launchpad and is packaged for ubuntu in a ppa.
https://code.launchpad.net/~oly/geany-python-code-checker/trunk
https://launchpad.net/~oly/+archive/geany
maybe useful for some one, you can toggle some options on and off as well like checking of line length.

Vim syntax highlighting not working (but works in gvim?)

I've followed all instructions given on this site with an empty .vim folder, but for some reason, python highlighting is not working on my system. It only highlights the comments and a few variables - nothing like the picture.
http://concisionandconcinnity.blogspot.com/2009/07/vim-part-i-improved-python-syntax.html
Is there some other setting I am forgetting?
I'm also using ubuntu 10.04 if that matters.
A weird other note - it works in gvim, but not vim?
If you don't want to change the colorscheme, you should check out CSApprox.vim. It allows you to use colorschemes made for gvim in vim.
http://www.vim.org/scripts/script.php?script_id=2390
The colorscheme used in that tutorial is only for gvim. Try changing your colorscheme.
I think ubuntu installs vim in a minimal package (vim-tiny) with some features missing. You can try to upgrade your vim to the full version:
sudo apt-get install vim-full

Categories

Resources