What is the Best Python IDE?
One question I’m most often asked by students is “What is the best Python IDE?” The simplest answer is “whichever you like the best”. A more useful answer, however, is that it’s a good idea to get a quick overview of what an IDE (Integrated Development Environment) is and what features it can provide for you when you’re coding. Then we can tour some of the most popular IDEs for Python, along with some of my personal favorites.
What’s an IDE?
Simply put, an IDE is where you write your actual code. It’s an important part of the software development process. When learning how to code in a programming language, you need to use a text editor to type out and execute your code. While in theory, you could use a simple notepad application for this, editing tools called IDEs have useful features for coding.
Last Updated June 2020
Learn Python like a Professional Start from the basics and go all the way to creating your own applications and games | By Jose PortillaExplore Course
A good IDE should have a user interface that helps you code better and faster. To do that, it should have the following features:
- Syntax highlighting and code formatting
- Every programming language has keywords and structures such as indentation and brackets. A good IDE will help you quickly see these keywords with the help of syntax highlighting (coloring different keywords different colors). You should also be able to customize these colors to your liking, for example, creating a dark mode vs light mode.
- Code formatting will automatically indent code for you as necessary. Code indentation is extremely important in Python and a good IDE will make sure your indentation and formatting are correct throughout the Python script.
- Code execution
- An IDE for Python should also let you run code from directly within the IDE. Instead of having to save your .py file and then opening your command line manually, a Python IDE will let you run both small bits of code or an entire script without having to close or leave the IDE program.
- While Python comes with its own debugging tools, it can sometimes be very helpful for an IDE to scan your code for issues automatically, such as a typo or importing a library but never using it. Using this feature highly depends on your particular coding style and whether you prefer to debug code manually yourself or get alerts from the IDE.
Text editors vs. Python IDEs
My students are often confused about the differences between general text editors (e.g. Sublime Text, Atom, Notepad++) and specific Python IDEs (e.g. Spyder, PyCharm). Text editors are simpler software programs that allow you to open any text file, edit its contents, and save those changes. For Python, this opening a PY file and editing and coding inside the text editor. The advantage of a text editor is that it’s not limited to any specific file type, meaning you can also edit things like HTML and CSS files if you are working on web development. This is useful when working with Python libraries such as Django or Flask that interact with front-end web development files. Having an IDE that can open multiple file types is a must.
Python IDEs on the other hand are development environments made specifically for Python. This can come with limitations because some Python IDEs are specialized for specific files and are unable to open other file types. These can include Python IDEs that use a “notebook” environment.
Now that we understand what IDEs and Text Editors are, let’s take a tour of some of the most popular IDEs available for Python programming.
Let’s learn about some IDEs specifically designed for Python:
PyCharm is a popular Python IDE created by the company JetBrains specifically designed for Python development. It comes with many features and tools for development, including built-in GitHub pull request support, in-editor exceptions preview, and debugging. This allows you to push code directly to a repo from within the PyCharm IDE and view bug exceptions that may occur in your code in-line with the actual Python code causing the issue. It also provides highlighting for potential errors, helping automate code refactoring, and can run unit tests with a click of a button. It’s a popular library that comes in a free community edition and in a paid professional edition. The professional edition comes with more built-in support for things like web development and data science.
You can download and find out more about PyCharm here.
Spyder is a Python-specific IDE designed for scientific libraries in Python and is heavily influenced by RStudio. Users new to Python coming from R will enjoy the similarities of window structure Spyder provides. It is very flexible and allows you to run Python code either by line, by PY script, or by cells of code. It has a built-in window for displaying visualizations and a variable exploration window, allowing you to explore variables assigned and data files. Spyder also contains a built-in debugger, allowing you to trace each step of your code’s execution interactively. It also has direct links to the documentation to save you the step of browsing online for documentation strings.
You can download and find out more about Spyder here.
Now let’s explore some of the most popular text editor options for Python:
Atom text editor
The Atom text editor is an open-source and free text editor IDE developed by GitHub. It works across multiple operating systems and comes with a built-in package manager, allowing you to customize Atom to your liking. It also has a file system browser and multiple panes, making it great for web development with Python. While not specifically designed for Python, Atom has many community-developed plugins that are free to download to help automate things like debugging and auto-complete. Its color themes are also customizable through a CSS file. Finally, since it is developed by GitHub, it comes with heavy support for interacting with a GitHub repository through the IDE, including push\pull capabilities.
You can download and find out more about Atom Text Editor here.
Sublime text editor
The Sublime text editor is one of the most popular text editors in the world, and not just for Python. Because it is a text editor for general purpose use, developers use Sublime Text as their go-to IDE for many programming languages. It is extremely efficient with the best performance compared to many IDEs. It should be noted that “out-of-the-box” Sublime is quite simple, but with the ability to add in community-developed plugins, users can add features such as command-line tools, Python debugging, customized color themes, and much more. It even includes a Python API that allows plugins to augment built-in functionality.
You can download and find out more about Sublime Text Editor here.
Visual Studio Code (VS Code)
VS Code is an open-source IDE from Microsoft that includes many built-in features, including built-in Python support. While designed for general use for many programming languages, VS Code comes with IntelliSense highlighting and autocomplete for Python, allowing for automatic text completion based on variable names and function definitions. It also has a built-in debugger inside the editor and the ability to perform git version control commands from within the IDE. VS Code also can install extensions to add more themes, powerful debuggers, and connections to additional services.
You can download and find out more about VS Code here.
Finally, let’s discuss the “notebook” based options for Python:
Notebook editors are specialized IDEs designed for data scientists and creating visualizations. It allows you to combine both markdown explanatory text with individual cells for coding. Jupyter officially supports more than just a Python kernel for code written in Python. It also supports Julia, R, and Scala. Its heavy integration with Python data science libraries means you can easily visualize your data from within your IDE without running your code as a separate script.
Jupyter Notebook and Jupyter Lab
Jupyter notebook is a simpler IDE where a user can focus mainly on data science tasks involving Python. JupyterLab is an expansion from the Jupyter notebook and notebooks are a core application within JupyterLab. JupyterLab also includes a direct console, command-line terminal, and a general text editor. An important thing to note is that Jupyter based systems use an IPYNB file type, meaning they are not useful for modular applications that require the creation of .py files.
You can download and find out more about this IDE here.
So which one do I use? It depends on what I’m doing. For data science and machine learning projects, I enjoy using Jupyter Notebook-based systems. For web development or larger projects, I use Sublime text editor, heavily customized with plugins for functionality and appearance. I highly encourage you to try all of these options and see which one you prefer!
Top courses in Python
Python students also learn
Empower your team. Lead the industry.
Get a subscription to a library of online courses and digital learning tools for your organization with Udemy for Business.