Press "Enter" to skip to content

PyCharm vs Spyder: a quick comparison of two Python IDEs

In this post, PyCharm vs Spyder will be compared. If you have followed my blog you may have noticed that a lot of focus have been put on how to learn programming (particularly in Python). I have also written about Integrated Development Environments (IDEs). I think that an IDE may, in fact, be very useful when learning how to code. Of course, when it comes to Python IDEs it may be hard to choose the best one (e.g., PyCharm vs Spyder?).

Spyder is one of my long-time favorite IDEs, and I am mainly using Spyder when I have to write code in Windows environments. However, in one of my blog posts PyCharm was suggested in one comment (see the comments on this post: Why Spyder is the Best Python IDE for Science) that I should test PyCharm.

After testing out PyCharm I started to like this IDE. In this post you will find my views on the two IDEs. E.g., I intend to answer the question; which is the best Python IDE; PyCharm or Spyder?

The post is divided into the following sections:

  1. Shared features of PyCharm and Spyder
  2. PyCharm
  3. Spyder
  4. PyCharm vs Spyder

In the first section (1) I will outline some shared features of PyCharm and Spyder. I will then continue with describing features that is unique to PyCharm (2) and Spyder (3). Finally, I will go on and compare the two Python IDEs (4).

Shared features of PyCharm and Spyder

I will start discussion some of the shared features of PyCharm and Spyder. First, the both IDEs are free (well, Spyder is “more” free compared to PyCharm but if you are a student or a researcher you can get the full version of PyCharm free, also) and cross-platform. This means that you can download and install both Spyder and PyCharm on your Windows, Linux, or OS-X machine. This is of course awesome! PyCharm and Spyder also have the possibility to create projects, an editor with syntax highlighting and introspection for code completion, and have support for plugins.

 

pycharm-best-ide-python

PyCharm

I must admit, the main thing I liked with PyCharm was that I could change the theme to a dark. I really prefer having my applications dark. That said, PyCharm of course comes with a bunch of features. I will not list all of them here but if you are interested you can read here. As I have mentioned earlier, both PyCharm and Spyder have support for plugins. However, I find it easier to find and install plugins in Pycharm. To install a plugin you just open up settings (File -> Settings) and click on “Plugins”:

PyCharm install plugins

 

This makes it very easy to search for plugins. For instance, one can install Markdown plugins to also write Markdown files (.md) that can be uploaded to your Github page. That leads me into another GREAT future of PyCharm; support for different types of Version Control Systems (VCS: e.g., GitHub, Subversion, and Mercurial). E.g., uploading your work to GitHub is only a few click aways (if you prefer not to use command line, that is).

Another great feature is that you can set the with of your code and PyCharm will end our line and move it to next line (great if you are a lazy programmer.)

Another feature of PyCharm is that you can safely rename and delete, extract your methods, among other things. It may be very helpful if you need to rename a variable that is used on various places in your code.

One of my favorite features is that you can, much like in RStudio for R, install Python packages from within the user interface. PyCharm offers an easy system to browse, download, and update 3rd party packages. If you are not only working with Python projects, PyCharm allso provides supprot for Javascript, CoffeScript, Typescript and CSS, for instance.

Spyder

Spyder GUI

First of all, Spyder is made in for and in Python! Of course this is not a feature of the IDE itself but I like that it’s quite pure Python!

However, one of the most obvious pros with Spyder is that is much easier to install (e.g., in Ubuntu) compared to PyCharm. Whereas PyCharm must be downloaded and installed, Spyder can be installed using Pip. It is also part of many Linux distributions package manager (e.g., apt in Debian Ubuntu).  There is one thing, however, that I really like with the Spyder interface; the variable explorer.

Spyder variable explorer

In Spyder it is also quite easy to get help. That is, if you are getting stuck, and is not sure how to use a certain function or method. The help function of Spyder IDE lets youtype in the object and get the document string printed out. It can come in very handy, I think.

Spyder help/object explorer

Spyder vs Pycharm

It is easier to install Spyder (at least in Linux) but PyCharm is not that hard to install. In fact, if you are running Ubuntu you can just add a PPA (See here on how to install PyCharm this way) and install PyCharm using your favourite package manager. If you are a Windows user, you just download an installation file (Download PyCharm).

Spyder is also part of two great Python distributions, Anaconda and WinPython. Anaconda is cross-platform and WinPython for Windows only. Both distributions comes with most of the Python packages that you may need (and probably more than you need!)  Thus, you will get a lot of what you need to write code and Spyder in one installation.

PyCharms have support for VCS systems (e.g., Git and Mercurial) is also a great feature that is in favor for PyCharm. I know that some people find this attractive; they don’t have to use the command line.

Okey, which IDE do I think is the best? I think that Spyder, still, is a great IDE. PyCharm do, of course, offer a lot more features. If you are running a relatively new computer and is using Linux (e.g., Ubuntu), PyCharm may be the best (almost) free Python IDE.

On the other hand, if you are using Windows and don’t want to install a lot of Python packages by your self, Spyder you can choose to install either Anaconda or WinPython.

In fact, in the lab where we run Windows 10 computers, I have installed Anaconda (as can be read in the comments, Python(x, y) is no longer maintained). Here I use Spyder but at home I tend to write in PyCharm.

In conclusion, for scientific use maybe Spyder is the best free Python IDE (for Windows, Linux and OS-X). If you are a more general programmer or want to have a lot of features within the user interface, PyCharm may be your choice!

30 Comments

  1. Dominykas Grigonis Dominykas Grigonis

    Am I missing something or this post contains almost “None” useful information for anybody trying to choose between these two.

    What about testing framework support (nosetests, pytest, etc)? How easy is it to change environments? and similar…

    • wtf wtf

      Pycharm is incredibly difficult to manage venv’s, especially when you are dealing with multiple machines or if your work regularly upgrades your laptop every year or two.

    • Spyder offers the Spyder-Unittest plugin, which adds integrated support for Pytest, Unittest, and Nose tests.

      With Spyder 3.3+, you can easily open an unlimited number of consoles in multiple Python environments (either venvs, conda envs, different Python installs or even kernels on remote machines) and switch between them on the fly so long as the Spyder-Kernels package is installed in the target environment to enable Spyder’s advanced functionality (Variable Explorer, etc). Spyder 4 will have a number of major improvements in this area with built-in GUI package and environment management and integrating them with an expanded version of the existing Projects system.

  2. Royi Royi

    Python(x, y) is a dead project.
    The best Python Distributions for Windows (Which are free as well) are Anaconda and WinPython (Which is also almost portable which is great).

    They both use Spyder.

    • Hey Royi,

      Thanks for the information. I will have a look at Anaconda and WinPython, and update the post with more correct information.

  3. Wasim Aftab Wasim Aftab

    Hi,
    Thanks for your the article.
    For your information, in spyder3 you can change the theme to dark
    Best,

    • Oh that is cool. Thanks for the information Wasib!

      Erik

  4. Thanks for the comparison, for now I’ll use PyCharm and see how it works out!

  5. Chand Chand

    I love Spyder and I think it’s the best IDE for data science but the fact that it doesn’t have a multi-select feature is a deal-breaker for me. Hence PyCharm ftw.

  6. shakif shakif

    i think spyder is best .

  7. Hey, is there a reason is Anaconda crossed out? This would seem to imply that Spyder is no longer included with it, when in fact it is one of its flagship IDEs and installed by default.

    Also, Spyder 4 is due for final release in the next couple months, with a built-in full-UI dark theme option, GUI package and environment management tools, an improved plugin system, and a brand new, much more powerful debugger and code completion/introspection/analysis architecture, plus hundreds of other improvements. It’d be cool to revist this article once that goes live, as well as developments in PyCharm plugins for scientific computing. Thanks!

    • Hey,

      No, there’s no reason for that and I’ve now removed that. Can’t really remember why it was crossed out.

      Sounds cool with Spyder 4. Personally, I am mainly using Jupyter Notebooks, right now. But I’ll definitely check Spyder 4 out. As an Anaconda user (on my Win computers) I still start Spyder 3 from time to time (e.g., for coding app I prefer an editor/IDE). Thanks for the heads up.

      Erik

      • C.A.M. Gerlach C.A.M. Gerlach

        Okay, thanks!

        Jupyter and Spyder are really quite complementary, since they serve distinct niches (although people tend to press the former into roles its not designed or optimal for, whether out of ignorance, convenience, familiarity, or cosmetic appeal). Jupyter notebooks can be a great tool for demonstrating concepts and showcasing short analysis routines, and we actually have a Spyder-Notebook plugin that allows you to work with Jupyter notebooks right inside of Spyder (along with plugins for dynamic report generation, OS terminal support unit tests, vim mode, memory profiling, etc). As you say, for any serious work that needs to be reproducible, modular, scalable or interoperable, Spyder is the choice.

        Aside from the “whiz-bang” factor of having all code and output inline and producing interactive HTML/CSS/JS visualization and output (which the Spyder-Notebook plugin enables), Spyder gives the researcher essentially the same core tools—line by line, cell-based or full-file execution, a log of all input and output, inline plots, the power of the IPython interpreter and Jupyter kernel infrastructure including the same magics and starting/connecting to any local or remote kernel, on-demand help, etc.—along with numerous others, all in a real native application rather than a web app and producing standard Python scripts, modules and packages that can be much more easily shared and re-used by anyone as opposed to operating within the limited confines of the Jupyter “bubble”.

          • I think Anaconda was crossed out because the link was broken (the plugin for checking broken links crossed it out). But thanks for the link,

            Erik

          • Although perhaps a bit less carefully worded than I would have liked, all that’s saying that Anaconda has ceased financially supporting Spyder development, which doesn’t have anything to do with them distributing Spyder (Anaconda doesn’t directly fund the vast majority of the packages included in the distribution). That’s also a year out of date; here’s the updated version:

            https://github.com/spyder-ide/spyder/wiki/Current-Funding-and-Development-Status

            I would have removed that one to avoid confusion as I wrote the updated one a good long while ago, but I still need to update some of the readmes for the many packages in our organization to point to the new link.

  8. Richard Adams Richard Adams

    FWIW, please accept my apologies. I didn’t see (until about a second or two after clicking “Post Comment” that the GitHub document I was posting as a response to a question was created by the same person that posed the question. /facepalm

    Btw, I love Spyder. Best of luck to you and your team.

    • No need to apologize! Actually Carlos Córdoba, Spyder’s lead maintainer, originally wrote that document you linked to; I only added some minor updates and fixes on that one. I should add a link to the updated version from that one, to make the current status clear. And thanks for your kind words!

  9. Ed Ed

    The one thing I like most about RStudio is that you can see the variable contents without putting print statements all over the place unlike the Python IDE where it is more cumbersome or one must put print statements.

    • That’s one of my favorite RStudio features as well. However, not sure which “Python IDE” you’re referring to, but as the author discusses and showcases a simple example of, Spyder actually has a full-featured Variable Explorer panel that can not only display dataframes like Rstudio in a custom viewer, but also Numpy arrays, Pillow images, Python lists, sets, dictionaries, and tuples, and even functions, classes, modules and arbitrary Python objects alongside all the basic scalar types, datatimes/timestamps/timedeltas and the like; on top of that, it actually actually lets you interactively edit any of these that are mutable, as well as perform a number of other operations. In most respects, I’ve actually found it *more* powerful than Rstudio.

      • Ed Ed

        It does not seem that Pycharm Spyder update the Variable Explorer as values are changed.

        • I don’t know about Pycharm (and I don’t think it *has* a Variable Explorer, so not sure what you’re talking about?), but Spyder’s Variable Explorer (as shown in the main window) does update dynamically. Opened sub-viewers (e.g. for dataframes, arrays, collections, etc) don’t update automatically with external changes (as opposed to ones you make directly there) by design (you can always open a fresh one), but we’re currently discussing adding a refresh button to existing Variable Explorer sub-windows.

  10. Henrik Henrik

    when it comes to execution speed, there is no way spyder can bet pycharm. Write a simple code and see for yourself.

    • Hey Henrik,

      Thank you for your comment. I’ll do as you suggest and add a line or two about this to the article,

      Best,

      Erik

    • > when it comes to execution speed, there is no way spyder can bet pycharm

      Can you present some justification for this bold and categorical claim? When it comes to executing your code in Pycharm and Spyder, the speed of both are ultimately dependent on the Python interpreter you are using with them, which can be chosen independently of the IDE itself (you can launch kernels on any Python install or virtual/conda environment on your machine with Spyder, or even remote ones via SSH, as you can with Pycharm). They both run IPython as their REPL for scientific work, so aside from any minor overhead in either IDE in communicating with the kernel and sending the relevant code/file to execute (which is trivial for any user code taking a meaningful amount of time), there is no clear reason why their execution times could be substantially different on any given interpreter.

      However, if you well-documented, reproducible test results running the same non-trivial code on the same interpreter in both that demonstrates a significant difference in runtime, then that’s something we would likely consider as a bug/limitation in Spyder and endeavor to fix.

      > Write a simple code and see for yourself.

      By “A simple code [sic]” a assume you mean a trivial example, which takes so little time to run that “execution speed” of the code (which should be meaningfully identical, since both Pycharm and Spyder can run on the same interpreters) can be washed out by sample variability, test conditions and and any small amount of overhead just sending the code to the respective console and telling it to execute, which could vary slightly between IDEs.

      A more valid test of “execution speed” would be running a computationally-intensive process (i.e. something that takes on the order of a minute) and comparing runtimes, although I see little point to doing this since there is no reason to suspect that the same code, running on the same Python interpreter, will suddenly behave differently based on what IDE was ultimately responsible for handing it off to the same.

  11. Dries Dries

    Dear Erik,

    ‘Tack’ for your analysis! After trying out PyCharm for a month and then switching to Spyder, I must say I prefer Spyder. This is mostly due to Spyder not having the overload of options which PyCharm does have. In PyCharm, every menu opens an overload of options and the code is also blinking in all kinds of ways. Spyder’s design is much more simple and clean.

    I think that it’s important to mention that Spyder currently does not have a proper version control system (VCS) integrated. But if you combine it with the git-cola GUI (which is also entirely written in Python!) you can do everything which you can do with the Rstudio IDE. This was important to me, as I worked in Rstudio before.

    Cheers, Dries

    • Dear Dries,

      Thank you for your comment. I’ll add a line or two about git, as you suggest, when I find time. Personally, I prefer to use git from the command prompt, actually. This is because I think I get better control over the VCS. Of course, for others it might be a game changer to be able to use VCS in the GUI of the IDE,

      Best,

      Erik

      • Dries Dries

        Dear Erik,

        I agree with you that one can get most value out of a VCS by using the command line. Repeatedly typing ‘add’ and ‘commit’ breaks the flow a bit for me, however. A nice GUI can make this faster through hotkeys.

        Also, I think combining the VCS command interface with a ‘diff’ screen makes it a lot easier to summarize what you actually changed in a file compared to the previous version. VCS GUIs such as RStudio and git-cola do this.

        So I would say, do basic version tracking (add, commit) through these GUIs, but more complex interactions (complex diff, merging) through the command line.

        Cheers,
        Dries

    • Hey Dries,

      Thanks for your kind words!

      We were actually planning a GSOC project this summer to have a student develop a Spyder plugin to integrate better Git support, using Git-Cola and qGit as the backend, to add all their main features as well as highlighting changed lines, merge conflicts, etc in the editor. Unfortunately, the logistics didn’t work out this year, but we hope to fund something like this sometime in the future. We also have an open, nearly final PR adding support for color-coding files in the Project file browser by VCS status (Git and Hg) that will hopefully make Spyder 4.

      Best,
      CAM

      • Dries Dries

        Hi CAM,

        I’m happy to hear that you’re working on a plugin. I must say that after finding git-cola, this is not an issue for me anymore. But as *all programmers are supposed to use a VCS* (according to a favourite paper of mine: Noble’s “Quick Guide to Organizing Computational Biology Projects” (2009)), I think that such a feature certainly has value.

        Thank you for your reaction and thank you for your work!

        Cheers,
        Dries

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: