Development Environments

A development environment is a combination of a text editor and the Python interpreter. The text editor allows you to write the code. The interpreter provides a way to execute the code you've written. A text editor can be as simple as Notepad on Windows or more complicated as a complete integrated development environment (IDE) such as PyCharm which runs on any major operating system.

Why is a development environment necessary?

Python code needs to be written, executed and tested to build applications. The text editor provides a way to write the code. The interpreter allows it to be executed. Testing to see if the code does what you want can either be done manually or by unit and functional tests.

While you're learning about development environments be sure to check out information on Vim and Emacs.

A development environment example

Here's what I (the author of Full Stack Python, Matt Makai) use to develop most of my Python applications. I have a Macbook Pro with Mac OS X as its base operating system. Ubuntu 18.04 LTS is virtualized on top with Parallels. My code is written in vim and executed with the Python 3.6 release via the command line. I use virtualenv to create separate Python interpreters with their own isolated application dependencies and virtualenvwrapper to quickly switch between the interpreters created by virtualenv.

That's a common set up but you can certainly write great code with a much less expensive set up or a cloud-based development environment.

Open source text editors

  • vim is my editor of choice and installed by default on most *nix systems.

  • emacs is another editor often used on *nix.

  • Atom is an open source editor built by the GitHub team.

Python-specific IDEs

  • PyCharm is a Python-specific IDE built on JetBrains' platform. There are free editions for students and open source projects.

  • Thonny is an open source Python IDE for new programmers. The tool bakes in syntax highlighting, code completion, a simple debugger, a beginner-friendly shell and in situ documentation to assist new developers who are just starting to code.

  • Wing IDE is a paid development environment with integrated debugging and code completion.

  • PyDev is a Python IDE plug in for Eclipse.

Proprietary (closed source) editors

  • Sublime Text versions 2 and 3 (currently in beta) are popular text editors that can be extended with code completion, linting, syntax highlighting and other features using plugins. If you are considering using Sublime Text for Python development, check out this 2016 in review - likes and dislikes about Sublime Text post that summarizes many of the positives and negatives of using the editor.

  • Komodo is a cross-platform text editor and IDE for major languages including Python, Ruby, JavaScript, Go and more.

Hosted development environments

Several cloud-based development environments have popped up over the past several years. These hosted environments can work well when you are learning or stuck on a machine with a web browser but otherwise no administrative privileges to install your own software. Most of these have free tiers for getting started and then require payment as you scale up your application.

  • CodeAnywhere is a cloud IDE that can be used in the web browser or on an iOS or Android device.

  • Cloud9 began as an independent company and is now owned by Amazon as part of Amazon Web Services.

Development environment resources

Development environments are unique to each programmer because Python is used for many different purposes. The following guides range from web development to DevOps and from getting started to data science. Even though your environment requirements are unique, you should be able to find someone who has set up something similar to what you need. Use that configuration as a starting point and customize it from there.

  • The definitive guide to setup my Python workspace is geared towards using Python for data science but the guide remains useful for configuring your system for any type of Python work. There is some solid advice in the post about not adulterating your global Python installation as well as how to split out many virtual environments for Python 2 & 3.

  • The Python subreddit had a nice thread with developers giving the specifications to their Python development environments in this post on What is in your Python Development Environment?.

  • Real Python has an awesome, detailed post on setting up your Sublime Text 3 environment as a full-fledged IDE.

  • Three Ways to Install Python on your Windows Computer provides multiple avenues for Windows users to get Python on their machine before setting up the rest of their development environment. Unlike macOS and Linux, the Windows operating system does not include Python with its default installation.

  • PyCharm vs Sublime Text has a comparison of several features between the two editors.

  • PyCharm: The Good Parts shows you how to be more efficient and productive with that IDE if it's your choice for writing Python code.

  • JetBrains' PyCharm Blog is required reading if you're using the IDE or considering trying it. One of the core developers also has an interview on the Talk Python to Me podcast that's worth listening to.

  • The Joy of Linux Desktop Environments talks about desktop environments, not specifically development environments, but provides an explanation for why the core Linux operating system is awesome for being unbundled from the desktop environment itself. You can change your desktop environment from just a command line without a windowing system to a full windowed system provided by Gnome, KDE or Unity for using the system and getting your programming work done.

  • The Hitchhiker's Guide to Python has a page dedicated to development environments.

  • If you're considering the cloud-based development environment route, check out this great article comparing Cloud9, Koding and by Lauren Orsini. She also explains more about what a cloud IDE is and is not.

Learn about Vim & Emacs next, or move on to web frameworks?

I want to learn how to code a Python web application using a framework.

Tell me about using the Vim editor for Python development.

I'd like to learn about Emacs for Python coding.

Sign up for a monthly email with Full Stack Python tutorials. No spam ever.

Matt Makai 2012-2018