Getting started with Anaconda

Anaconda Distribution contains conda and Anaconda Navigator, as well as Python and hundreds of scientific packages. When you installed Anaconda, you installed all these too. You can try both conda and Navigator to see which is right for you to manage your packages and environments. You can even switch between them, and the work you do with one can be viewed in the other.

Now, try this simple programming exercise two ways, with Navigator and a terminal, to help you decide which approach is right for you.

Your first Python program: Hello, Anaconda!

Write and run a Python program using Anaconda Navigator.

1. Open Navigator

Choose the instructions for your operating system.

Windows

From the Start menu, click the Anaconda Navigator desktop app.

../../../_images/navigator-anaconda-prompt.png

macOS

Open Launchpad, then click the Anaconda Navigator icon.

Linux

Open a Terminal window and type anaconda-navigator.

2. Run Python in Spyder IDE (integrated development environment)

TIP: Navigator’s Home screen displays several applications for you to choose from. For more information, see links at bottom of this page.

On Navigator’s Home tab, in the Applications pane on the right, scroll to the Spyder tile and click the Install button to install Spyder.

NOTE: If you already have Spyder installed, you can jump right to the Launch step.

Launch Spyder by clicking Spyder’s Launch button.

In the new file on the left, delete any placeholder text, then type or copy/paste print("Hello Anaconda").

In the top menu, click File - Save As and name your new program hello.py.

Run your new program by clicking the triangle Run button.

You can see your program’s output in the bottom right Console pane.

3. Close Spyder

From Spyder’s top menu bar, select Spyder - Quit Spyder (In macOS, select Python - Quit Spyder).

4. Close Navigator

From Navigator’s top menu bar, select Anaconda Navigator - Quit Anaconda-Navigator.

Write a Python program using Anaconda Prompt or Terminal

1. Open Anaconda Prompt

Choose the instructions for your operating system.

Windows

From the Start menu, search for and open “Anaconda Prompt”:

../../../_images/anaconda-prompt.png

macOS

Open Launchpad, then click the Terminal icon.

Linux

Open a Terminal window.

2. Start Python

At Anaconda Prompt (Terminal on Linux or macOS), type python and press Enter.

The >>> means you are in Python.

3. Write a Python program

At the >>>, type print("Hello Anaconda!") and press Enter.

When you press enter, your program runs. The words “Hello Anaconda!” print to the screen. You’re programming in Python!

4. Exit Python

On Windows press CTRL-Z and press Enter. On macOS or Linux type exit() and press Enter.