Written by Michele Pratusevich. One barrier to learning programming is getting your development environment set up. Whether you are on Windows, OSX, or Ubuntu, this guide will help you set up your computer with a basic Python installation so you can start your own journey with Python!
“I haven’t installed Python.” “I don’t want to mess up my computer by installing new software.” “I have a Windows machine.” I’ve heard all of these and more from readers as an excuse for not starting to learn Python. Never fear! Installing Python is a painless process for all 3 major operating systems (disclaimer: I haven’t tried installing it on anything except Windows, OSX, and Ubuntu so I can’t speak for any other system), and there are even installation-free alternatives if you just want to play around with basic syntax and code.
I’ll go through my recommendations for installing Python on Windows, OSX, and Ubuntu, and then list a few no-installation-required options. You are not limited by your operating system!
Whether you are on Windows, OSX, or Ubuntu, and want to quickly get started with Python, my recommendation is to install Anaconda Python. The company that distributes Anaconda specifically packages Python and a few useful libraries, such as Numpy and Scipy into an easy installer. It will create a desktop icon for Python, and will install a tool called
conda that you can then use to install any extra Python packages you need.
Another benefit: you don’t need administrative permissions! You can install Anaconda anywhere you have write permissions, such as your user’s home directory.
You can read the official Anaconda installation recommendations on their docs page. It’s as easy as downloading and running the installer!
You can’t write your program in Microsoft Word. What you need is a text editor - a program that lets you edit text (programs!) without getting in your way. On Windows, you can use regular old Notepad, or a souped-up free version called Notepad++. You can also install my favorite text editor, Sublime Text, on Windows. Regardless of which editor you use, you can run your
If you can’t install packages on your Windows computer because it is a shared computer, check out the section on options where you don’t need to install anything.
For text editors, OSX comes with Xcode, but I recommend using a text editor like Sublime Text, which you can download for free.
For those who will be doing more serious Python development or want to use the command-line to install Python, I recommend doing the following (not for the faint of heart):
brew install python3. (You’re using Python 3, right?)
Now you can run Python from the command line by running
python3 to get a Python shell, or writing a Python program in a text editor and running
python3 MyProgram.py. To install Python packages, you run
pip3 install PACKAGE_NAME on the command line.
Yep, you can install Anaconda Python for Ubuntu as well. It’s a great option, even for experienced terminal users.
But if you don’t want to use Anaconda, you can use
apt to install Python 3:
Then, to write Python programs, use your favorite text editor (have you guessed that my favorite is Sublime Text?), and run your Python programs by doing
apt also installs
pip3, which is the Python-recommended way of installing Python packages. So if you want to install
numpy, you would do
And it will install
numpy to let you write
import numpy at the top of your Python programs.
If you can’t (or don’t want to) install Python on your computer, there are a number of options for learning to code in Python that don’t require installing any software. You can even do some of these options from an iPad or Android/Windows tablet!
My list is not comprehensive, and if you find another solution out there that works for you, please email me and let me know.
While using browser-based editors is fantastic for learners and casual coders, if you are going to be doing any serious data processing or multi-file coding, I suggest you install Python on a computer so you can have more control and processing power on your local machine.
Your environment doesn’t matter - if you want to learn how to program, solve logic problems, and think analytically, there are many options out there for you! Just pick one and get started.