What is the Best IDE for Python?

Python for Matlab Users, Part 3: Choosing an IDE

Rasmus Gundorff Sæderup
The Startup
5 min readAug 31, 2020

--

This is part 3 in a series on Python for Matlab users. Part 1 is about why one might use Python over Matlab can be read here, and part 2 on installing can be found here.

Now, this is where things start to get complicated. There are a ton of Python IDEs out there, with as many opinions on which is the best as there are Python developers. I will therefore not tell you which one is the best, as what is the best for me might not be the best for you. I will however summarize the pros and cons of a few IDEs below

A table comparing key features for the most typical Python IDEs

All of the above are all cross-platform meaning they work for both Windows, OSX and Linux.

In the following, I will provide a brief walk-through of the IDEs.

Ive taken a screenshot from each IDE, showing what it looks like when you multiply two random matrices a and b.

Atom

Atom is actually just a text editor, but it supports a ton of plugins. This makes it possible to turn Atom into a quite feature-rich Python IDE.

The most popular Python plugin is Hydrogen which allows you to run Python (and Jupyter) code in Atom.

However, being built entirely on plugins, the Python support in Atom doesn’t have the same native feel and look as some of the other IDEs. Debugging in Atom is also quite complicated. But for lightweight Python scripting, it’s very capable.

Good for: Lightweight scripting in a nice editor with many plugins.

Jupyter Lab

Jupyter Lab is the IDE extension of Jupyter Notebooks, and just like the Notebooks it also runs the browser. However you get nice additions such as a terminal and the option to include plugins such as a variable explorer and a debugger.

Jupyter Lab runs really well and, with plugins, contains all the basic building blocks you would expect from an IDE.

Good for: General purpose scripting and debugging

Jupyter Notebooks

Jupyter notebooks are a quick and simple way to quickly write and run some code and document it meanwhile. See, Jupyter Notbooks are just like the Live Scripts in Matlab, where you can combine code and text in a single document. This is very useful for when you want to create a simple example to show off a new feature or for doing homework assignments.

A cool thing about Jupyter notebooks is that they run in the browser, i.e. no IDE is installed. However, there is no debugger provided, and you never really get the IDE-feel you do with some of the other tools.

Good for: Lightweight mock-ups and homework assignments and documenting your code.

PyCharm

My impression with PyCharm is that it’s a huge program which can do anything you would expect from a full-fledged Python IDE. It has a great debugger, variable explorer and has support for many plugins.

I only see two disadvantages:

  1. As opposed to the other IDEs presented, PyCharm is not free, unless you are eligible for the academic version. There is a free version available, but in this you don’t get the highly useful Scientific View which includes the variable explorer and generally makes PyCharm very Matlab-like (see here for more).
  2. It can be quite complicated to get started. You have to configure which Python interpreter to use, as well as configure projects and a bunch of other settings. Sure it can be done, but if you just want to get started it can feel a bit overwhelming.

Good for: Big, complex simulations where a full IDE and powerful debugger is needed.

Spyder

Spyder is probably one of the most famous Python IDEs as it is shipped by default with Anaconda. This means it can simply be opened from the Anaconda Navigator. It is very similar to Matlab, and contains a console, variable explorer and debugger by default. However, there is no support for Jupyter notebooks.

So for making math-heavy scripts where you need a debugger and variable explorer, Spyder is an obvious (and easy) choice.

Good for: What you would normally use Matlab for

Visual Studio Code (VScode)

Visual studio is one of the most popular Python IDEs due to its simplicity and light-weight implementation. It is therefore easy to find help should you have any problems, and it is currently under heavy development, received updates quite often. It doesn’t have as many features as e.g. PyCharm, but it still does the most essential stuff.

If you need a good resource for setting up Python in VS code, you can check out this nice guide Miguel Grinberg:

Good for: More lightweight scripting than what you would do in Matlab

Now that we have gone through the various IDEs, it’s time to pick one and install it. My recommendation would be to start with Spyder unless you have a reason or strong desire to try one of the other IDEs.

In the next part, we will be looking at environments and packages which are good ways to structure your code and to keep your workspace organised between different projects.

--

--