Python Programming from First Principles: Learn to Code, Think Computationally, and Solve Real-World Problems
PDFEPUB
CHAPTER GUIDE · GETTING STARTED

Install on Linux

On this pageDownloadInstallVerifyTest PythonTroubleshooting

Install Python in your user account without replacing Linux’s system Python.

Download

  1. Open your distribution’s Terminal application and check the processor architecture:
uname -m
Listing 13 — Identify the Linux architecture.
  1. Open the Anaconda download page.1 Choose a supported Linux installer matching the result: typically x86_64 or aarch64.
  2. Save the .sh file in Downloads and note its exact filename. Check the supported-system requirements, particularly for ARM devices.2

Install

  1. Run the downloaded installer with bash. Replace INSTALLER.sh below with the actual filename:
bash "$HOME/Downloads/INSTALLER.sh"
Listing 14 — Start the downloaded installer; substitute its filename before running.
  1. Press Enter when prompted, read the licence and enter yes if you accept it.
  2. Press Enter to accept the proposed installation folder in your home directory, or enter another writable location.
  3. Enter yes when asked to initialise conda. This lets new terminal sessions recognise its commands.
  4. Wait for completion, then close and reopen Terminal.

Verify

  1. Enter these commands separately:
conda activate base
conda list
Listing 15 — Select the installed environment and list its packages.

The package list confirms that conda is available.

  1. Check Python:
python --version
Listing 16 — Display the selected Python version.

The result should begin with Python 3.

Test Python

  1. Start Python:
python
Listing 17 — Open Python’s interactive prompt.
  1. At >>>, type the following statement without the prompt symbols:
print("Hello from Python!")
Listing 18 — Run a first statement on Linux.

The output is:

Hello from Python!
Listing 19 — Expected output.
  1. Enter exit() to return to Terminal.

Troubleshooting

  • Installer not found: check the downloaded filename and folder; replace INSTALLER.sh with the actual name.
  • Permission denied: choose an installation folder writable by your account.
  • conda is not found: reopen Terminal and check the official shell-initialisation instructions.
  • Another Python starts: activate base, then run python -c "import sys; print(sys.executable)" to identify it.
  • Architecture error: compare the installer with uname -m and the supported-system requirements. ARM support does not cover every ARM device.

  1. Anaconda, Download Anaconda Distribution.↩︎

  2. Anaconda, Linux installer. Covers architecture support, installation prompts, shell initialisation and verification. Checked on 22 October 2026.↩︎