Beginner Level
Intermediate Level
Python for Networking

1.4 Installing Python 3 on Ubuntu and macOS

In this video, you will install Python 3, IDLE, and pip on Ubuntu from the terminal, and learn how macOS users install Python from python.org.

Check your machine, then install with apt

On Ubuntu, first check whether your machine is 64-bit or 32-bit by typing uname -m in the terminal: x86_64 means 64-bit, while i686 indicates a 32-bit machine. Open a terminal — right-click on the desktop to open it; it works like the Windows command prompt for running system commands. Install Python 3 with sudo apt-get install python3, run as root so you have the privileges to execute it. Most Linux systems already come with Python 3, so on the presenter’s machine this step simply confirmed the newest version was already there.

IDLE and pip

Next, install IDLE, the interactive development environment for Python, with apt-get install idle3, confirming with y when asked. Then install python3-pip, which you need to download libraries that are not already on your machine, with apt-get install python3-pip, again confirming with y. Once these are installed, open the Python 3 interpreter from the terminal simply by typing python3, which gives you the same interpreter as on Windows, ready to import libraries and run commands.

macOS installation

The video does not demonstrate macOS, because the presenter did not have a Mac at the time. For macOS, go to python.org/downloads, find the .dmg file that suits your macOS version, download it, run it, and follow the installation instructions — it installs Python and all the libraries you need.

Key takeaways

  • On Ubuntu, check your architecture with uname -m: x86_64 is 64-bit, i686 is 32-bit.
  • Install with sudo apt-get install python3, then apt-get install idle3 for IDLE, then apt-get install python3-pip for downloading libraries.
  • Most Linux systems already ship Python 3; the install commands confirm it and add the tools.
  • On macOS, download the matching .dmg from python.org/downloads and follow its installer.

Watch the video lesson

Note: the mid-video detour fixing dpkg front-end lock errors was skipped as incidental; the python3-pip download was left unfinished in the video because of a very slow connection, so the guide gives the command only; two unexplained interpreter lines the presenter told viewers to ignore were also skipped.