These are chat archives for spyder-ide/public

17th
Sep 2018
Olaf
@randomgambit
Sep 17 2018 00:16
@ccordoba12 just tried the version 4 and looks pretty smooth. something a bit disappointing though is the autocomplete. I mean, have a look at Rstudio to see what autocomplete means! :) Spyder barely autofills my basic pandas functions...Am I missing something here? thanks!
CAM Gerlach
@CAM-Gerlach
Sep 17 2018 00:18
@randomgambit That will hopefully be much improved in Spyder 4 Beta 2, with the overhaul of the entire completion architecture to use the Language Server Protocol—same as Atom and VSCode. The basic work is already done, though some fine-tuning and bug-fixing remains.
Olaf
@randomgambit
Sep 17 2018 00:22
@CAM-Gerlach looking forward to it!!! :) thanks guys!
CAM Gerlach
@CAM-Gerlach
Sep 17 2018 00:39

I definitely miss the smoothness and complete-ness of Rstudio, but there are a few reasons for the difference as I understand it. First, Rstudio only does dynamic analysis to do completion—i.e. you have to have loaded the package or run the code that you're trying to complete; Rstudio won't complete something that isn't already loaded into memory (at least, that was how it worked back when I was a big Rstudio user). This is what Spyder does in the Console by default, though you can enable several options in the preferences to allow for "greedy" completion, or to use static analysis (Jedi) instead. Meanwhile, the Editor uses static analysis to get its completions, which can be somewhat less snappy and comprehensive than dynamic analysis since it has to do all the hard work itself (rather than just viewing the "result" in memory) but do not require running your code first and is updated on the fly as you make changes, vs. requiring a re-run. Due to differences in the best-practice Python data analysis workflow vs. what's more common in R, as well as philosphical differences between Spyder and Rstudio, this makes more sense than it would in R, though it sometimes takes time to appreciate.

Finally, there are a few other factors making it more difficult in PyData vs R: to the fact that most of the core PyData packages are compiled C++ code, most of the array/dataframe/data science syntax bolted on vs. being a core part of the language, being an overall a little less high-level and application specific and more flexible and powerful, vs. a language designed to be highly introspectable like R (at the cost of performance and utility for general-purpose programming), as well as other package- and language-specific issues with introspecting certain functions and methods, its just not as simple a problem to solve. In particular, there are a lot of known issues with Pandas and completion that affect most if not all other IDEs' completion engines as well that are difficult if not impossible to solve on our end. But what we can do, hopefully LSP will help a lot, at least ensuring we have parity with the other top Python editors.

Hope that answers your question @randomgambit
Olaf
@randomgambit
Sep 17 2018 00:59
@CAM-Gerlach sure, very interesting read. thanks!
VidCool
@vchan13620_twitter
Sep 17 2018 02:41
hello
CAM Gerlach
@CAM-Gerlach
Sep 17 2018 02:42
Welcome @vchan13620_twitter! What can we do for you?
VidCool
@vchan13620_twitter
Sep 17 2018 02:43
I would like to upgrade my python version to 3.6. Currently, it is 2.7
how can I do that?
CAM Gerlach
@CAM-Gerlach
Sep 17 2018 02:48

@vchan13620_twitter That doesn't really have anything to do with Spyder, actually. However, if you're using Anaconda (as we recommend), you can do so by simply creating a new Python 3 environment to work in with conda create -n python=3 and installing the packages you want to work with (such as spyder). Or, if you are currently running Anaconda2, you can switch to Anaconda3 (recommended) by just uninstalling your copy of Anaconda2 and installing Anaconda3 (we strongly recommend the x64 and Python 3.6/3.7 version unless you have specific requirements that dictate otherwise) from Anaconda.com.

Otherwise, it depends on how you installed Python; you can download a package from python.org with the newest version, or through your system package manager. However, we recommend Anaconda since it simplifies a lot of the process, avoids many common errors and pitfalls with other methods, keeps things isolated in their own environment and is what we are able to offer individual install-related support for.