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

Install on Windows

On this pageDownloadInstallVerifyTest PythonTroubleshooting

Install Python on Windows using Anaconda Distribution.

Download

  1. Open the Anaconda download page.1
  2. Choose Anaconda Distribution → Windows graphical installer for the computer’s system type.
  3. Save the .exe file in Downloads.

Install

  1. Open the installer from Downloads.
  2. Select Next, read the licence agreement and accept it to continue.
  3. Choose Just Me and keep a suitable installation folder.
  4. Keep Create shortcuts selected.
  5. Leave Add Anaconda3 to my PATH unchecked; the checks below use Anaconda Prompt.
  6. Keep the default Python registration setting unless another Python installation must remain the default.
  7. Select Install, wait for completion, then select Finish.

Verify

  1. Open Start, type Anaconda Prompt in the search field and select the application. Figure 1 shows the application to look for.2
Official Anaconda documentation screenshot showing Windows search results for Anaconda Prompt.
Figure 1 — Finding Anaconda Prompt in Windows. Screenshot: Anaconda documentation; the Windows appearance may differ.
  1. In Anaconda Prompt, enter the following command and press Enter:
conda list
Listing 3 — Check that conda can list the installed packages.

A list of package names and versions confirms that conda is available. The prefix (base) in the prompt identifies the initial environment.

  1. Enter the next command:
python --version
Listing 4 — Check the Python version in the selected environment.

The result should begin with Python 3 followed by a release number. The exact number depends on the installed distribution.

Test Python

  1. In the same Anaconda Prompt window, enter:
python
Listing 5 — Start Python’s interactive interpreter.

Python displays its version information followed by the >>> prompt. This prompt means that Python is ready to accept a statement. It is not part of the statement to type.

  1. At >>>, enter the following statement and press Enter:
print("Hello from Python!")
Listing 6 — Display a first message.

The output is:

Hello from Python!
Listing 7 — Output from the first statement.
  1. Enter exit() and press Enter to return to Anaconda Prompt. Python statements belong at >>>; commands such as python --version belong at the terminal prompt.

Anaconda Navigator is the distribution’s graphical application. It can also be found through Start, as shown in Figure 2. Opening it is optional for the checks above.

Official Anaconda documentation screenshot showing Windows search results for Anaconda Navigator.
Figure 2 — Finding Anaconda Navigator in Windows. Screenshot: Anaconda documentation.

Troubleshooting

  • Anaconda Prompt does not appear: confirm that installation finished and shortcuts were enabled. Restart Windows if the Start menu has not refreshed.
  • conda or python is not recognised: close the window and open Anaconda Prompt from Start. An unrelated terminal may not have the Anaconda environment available.
  • A different Python installation starts: return to the terminal prompt and enter python -c "import sys; print(sys.executable)". The displayed path identifies the interpreter being used.
  • Installation reports a permission error: run the installer from Downloads, choose Just Me and select a folder writable by the current account. On an organisation-managed computer, ask the administrator for the approved installation method.

  1. Anaconda, Download Anaconda Distribution. Supported systems and installer choices are listed on the current download page.↩︎

  2. Figures 1–4 reproduce screenshots from Anaconda’s Windows graphical installer documentation. These are official documentation images, not captures from the author’s computer.↩︎