-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove invalid auto completion options #237
Comments
Hi. You shouldn't get any completion from words in your buffer as you have About pandas, I know Jedi (the library that anaconda uses for autocompletion) had some problems with it in the past (as well as with other libraries that use some level of "magic" or tricks) so it's possible that you don't get all the autocompletions for some sort of objects in some libraries. In the other hand, those kind of problems are already known in Jedi project and Anaconda is moving to more up to date versions of the stable Jedi library in the next release. |
Thanks for the quick reply! I restarted ST and still see the words in the buffer when I type "df." .. any logs I can send to you? (btw, I do have anaconda_linting set to false but I presume that shouldn't affect this behavior) Also, is there a dev branch of Anaconda that uses a newer version of Jedi that I can try? |
Hi again. Depending on your operating system you can find logs in:
If you are using Linux or OS X, you can see how the plugin interacts with the JsonServer tailing the log file ( You don't need linting to fire autocompletion. About Jedi, anaconda doesn't have a branch with a most up to date version of jedi but install a new version in your own copy of anaconda is pretty straightforward, you just need to donwload it from the Jedi repo in GitHub and replace the |
Hi - I'm using OS X (10.10) and looked at the log file. It looks like no completions are returned when I type "df." or even "pd." but I do see a ton of completions when I do "np." .. here's what I see for "df.":
I downloaded the Jedi master branch from Github and replaced the existing jedi folder in Anaconda, then restarted ST, and tried again but still no luck.. it appears the problem is w/ Jedi then? And it also looks like autocompletion doesn't work for the entire pandas package (since I couldn't do "pd." and get valid autocompletions either). I also tried the dev branch of Jedi and that does raise an error when I try autocompletions for anything from pandas:
I'll open an issue w/ Jedi, looks like they've added support for numpy/scipy/etc but I don't see an explicit mention of pandas. |
Hi. The error that you get with the new version of jedi es because seems like they removed the Let me know what David tells you in Jedi's project. |
Hi - I was looking at a few threads on the Jedi project, and found this thread. So I installed jedi via pip, then tried the following in a Python console:
Both the above work and I see a bunch of completions. [Interestingly, the one in the thread with the numpy array "a." doesn't work but I suspect that fix has not yet been released.] The version of jedi installed by pip is 0.8.1-final0. I don't see a 0.8.1-final0 tag in the jedi project but there is one w/ v0.8.1 so I tried replacing the jedi folder in Anaconda w/ the 0.8.1 jedi library. But I'm still not getting any autocompletions for pd. or df. in Anaconda. I'm wondering now if there's a problem w/ Anaconda and the way it interacts w/ jedi? |
Hi. Can you take a look at the logs? |
The Anaconda log looks the same as before (completions list is empty). Or did you mean a different log? |
Hi - thanks a lot for the information and that screenshot! That helped me figure out what was going on. Turns out that ST3 doesn't pick up the python interpreter from my path, instead it was using the system one. I specified the python interpreter for ST3 (and also in Anaconda, though it looks like Anaconda does pick it up from the path) and it's working now! (I also ended up upgrading to ST3 3066 as I was using 3065). One thing I noticed was that ST3 hangs quite a bit after I trigger an autocomplete (for reference, I haven't had ST3 hang at all for the last few months that I've been using it). I force quit the app and have the Console log/trace but can't seem to find a log file for ST3. Don't see anything related to the hang in Anaconda logs. Think I can reproduce at will now - if I trigger an autocomplete, and then switch to another app before the results of the autocomplete show up, ST3 hangs. I take it this is an ST3 issue? |
I think your anaconda configuration is still wrong, ST shouldn't hangs at all. Can you make a gist with your Anaconda.sublime-settings and your project configuration? BTW: What do you mean with "I specified the python interpreter for ST3 "? |
Hi, This gist has my Anaconda and ST3 settings. Not sure what "project configuration" means but I don't have any specific configuration for this project. I misspoke above .. it's not ST3 python interpreter, but the interpreter for SublimePythonIDE, which I'd installed a while back. I just removed this package since I don't think it's needed anymore given Anaconda. I can't reproduce the crash anymore! Thanks for catching this! However, there is one new issue - when I type "pandas." the default completions show up for a second (or more if it's the first time after the Anaconda server starts up) before the Anaconda completions replace the default ones. I believe this is what the two suppress_* config options in Anaconda are for, so maybe there's a problem with my Anaconda config. I also tried adding the two suppress options to the Python.sublime-settings file but that did not work either. |
Hi Yup, SublimePythonIDE and anaconda are not compatible at all :) The new issue that you are experimenting is not an issue, is normal anaconda behavior. Let me explain. Anaconda is 100% asynchronous, that means that when ST3 send a signal saying "hey anaconda, I want you fire any autocompletion that you have to give me", anaconda just fires the autocompletion request into the anaconda's JsonServer and return back an empty response to ST3, that is because anaconda will never block waiting to perform any operation. Then, when the anaconda's JsonServer has a result available, it return it back to ST3 and anaconda inject the results in the ST3 autocompletion firing it again. As you already know, the first time that you are going to autocomplete something, Jedi build an index and then its contents are cached, with normal size Python packages that operation is almost instant so the user doesn't notice anything, but with Pandas, Numpy, PyQt, PySide, PyGTK there is a small delay between the anaconda plugin sends the request to the JsonServer and the request comes back with the new content. The other option is totally block the ST3 interface while the index is being built that is in fact, not an option :) Enjoy Anaconda and feel free to close this issue if you are satisfied already with the support. Regards. |
Hi - thanks for explaining the architecture. Few questions:
|
Hi again.
If you want to see 1 and 3 implemented, please, fill a couple of feature request issues. Thanks. |
Hi - will file the feature requests and yes, iPython is pretty cool! Thanks a lot for all your help and work, Anaconda is pretty cool too! |
Update - it appears that Anaconda does not take over auto-completions in the iPython SublimeREPL.. I'm not sure how/why it did that day when I reported this but I can't reproduce it anymore. Will keep an eye out and update if I see otherwise but all good for now on that front. |
Hi DW,
Been trying out Anaconda with pandas in Python, and have a couple questions:
Currently, I get completion options that include the names of other DataFrames in my file, other variable names, etc. which are not valid candidates for completion.
I have the following in my Sublime settings:
and the following in my Anaconda settings:
Thanks!
The text was updated successfully, but these errors were encountered: