Difference between revisions of "Installing Anaconda and Spyder"

From PrattWiki
Jump to navigation Jump to search
(update for Fall 2023)
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
This is the Fall 2022 version of the installation page.  It is written specifically for EGR 103 but works for other classes too - just change the Box folder when asked.  At the start of the Fall 2022 semester, the following were the most up-to-date versions of things:
+
This is the Fall 2023 version of the installation page.  It is written specifically for EGR 103 but works for other classes too - just change the Box folder when asked.  At the start of the Fall 2023 semester, the following were the most up-to-date versions of things after installing and updating:
* Anaconda 2022.5 with Python 3.9
+
* Anaconda 2023.7 with Python 3.11.4
** Spyder 5.1.5
+
* Anaconda Navigator 2.4.2
** Numpy 1.21.5
+
* Spyder 5.4.3
** Scipy 1.7.3
+
* Jupyter Notebook: 6.5.4
** Sympy 1.10.1
+
* Numpy 1.24.3
** Matplotlib 3.5.1
+
* Scipy 1.11.1
** Jupyter 6.4.6
+
* Sympy 1.11.1
 +
* Matplotlib 3.7.1
 +
* Pandas 2.0.3
  
If you have already installed Anaconda and need to update it, you can probably just open the Anaconda Prompt and type
+
* If you have '''previously''' installed Anaconda and need to update it, you can probably just open the Anaconda Prompt (Windows - go to Start/All Apps - Anaconda3 - Anaconda Prompt) or a Terminal (macOS - go to search and look for and start terminal) and type the following (accepting all prompts in between)
 +
conda update conda
 
  conda update --all
 
  conda update --all
 
If you want to read more about keeping Anaconda and everything else up to date, read this blog post about [https://www.anaconda.com/blog/keeping-anaconda-date Keeping Anaconda Up To Date]
 
If you want to read more about keeping Anaconda and everything else up to date, read this blog post about [https://www.anaconda.com/blog/keeping-anaconda-date Keeping Anaconda Up To Date]
Line 24: Line 27:
  
 
=== Installation ===
 
=== Installation ===
* Go to [https://www.anaconda.com/products/individual https://www.anaconda.com/products/individual] and click the Download button if the correct version is listed just below it or pick the appropriate distribution from the "Get Additional Installers" section and download the package.  You will want to use the graphical installer and almost definitely the 64-bit unless you know you have a 32-bit processor.
+
* Go to [https://www.anaconda.com/download https://www.anaconda.com/download] and click the Download button if the correct version is listed just below it or pick the appropriate distribution from the "Get Additional Installers" section and download the package.  You will want to use the graphical installer and almost definitely the 64-bit unless you know you have a 32-bit processor.
* You are not required to create an Anaconda account, but you are certainly allowed to.
+
 
* You can use all the default recommendations for the installation or, if you are sure you know what you are doing, you can make changes.
+
* See specific instructions below depending on operating system
* You can also look at the tutorial and such, though on your own time a little later in the lab  :)
 
* Once installed, start the Anaconda Navigator.
 
* In the Navigator window, there may be multiple items.  One of them should be Spyder. 
 
* If Spyder asks about installing Kite, you can install Kite.  It is an add on to Spyder that provides more in-depth help with Python commands.  '''Note:''' if you are using a Duke VCM to run Anaconda, you will not be able to install Kite.
 
  
 
==== Windows Installation and Setup ====
 
==== Windows Installation and Setup ====
* Save the installer to your hard drive.  It will be on the order of 500 MB.
+
* As the installer runs:
* Run the installer.  You can generally accept all the default options. Note that installing may take some time - Anaconda installs several packages and libraries by default.
+
** You will need to agree to the license agreement
* During the setup, you can choose whether you want to learn more about Anaconda Cloud or how to get started with Anaconda.  The former shows you how to share documents and projects in a cloud environment, while the latter gives an overview of Anaconda and Spyder. If you are new to Anaconda, we highly recommend you go through the [http://docs.anaconda.com/anaconda/user-guide/getting-started/ Getting started with Anaconda]Note that for EGR 103 we will be using Spyder and Jupyter Notebooks but not writing programs with the Anaconda prompt or terminal - once you get to the "Close Jupyter Notebook" and "Close Navigator" part of the Getting Started page, everything below that is interesting but not applicable to EGR 103.
+
** You should install for "Just Me" unless you know you have a reason not to
 +
** You can use the default installation folder unless you know you have a reason not to
 +
** For the advanced installation options, leave the defaults unless...you know...
 +
** Once done, it is up to you if you want to see the Anaconda Distribution Tutorial or Getting Started with Anaconda.
 +
** You are not required to register for Anaconda Nucleus, but can if you choose
 +
* Once installed, you will want to update everything.   
 +
** Open the Anaconda Prompt (Windows - go to Start/All Apps - Anaconda3 - Anaconda Prompt) or a Terminal (macOS - go to search and look for and start terminal) and type the following (accepting all prompts in between)
 +
conda update conda
 +
conda update --all
 +
 
 +
* Once installed and updated, start the Anaconda Navigator.
 +
** You do not need a cloud account, but you can create one if you want.
 +
** Once Navigator starts, it may say there is a new version.  The current version installed and updates as of 8/23/2023 is 2.4.2After that is there, the current versions of relevant packages will be:
 +
*** Anaconda 2023.7 with Python 3.11.4
 +
*** Spyder 5.4.3
 +
*** Jupyter Notebook: 6.5.4
 +
*** Numpy 1.24.3
 +
*** Scipy 1.11.1
 +
*** Sympy 1.11.1
 +
*** Matplotlib 3.7.1
 +
*** Pandas 2.0.3
 +
 
 +
* In the Navigator window "Home" panel, there may be multiple items.  One of them should be Spyder. Click on "Launch"  
 +
* If Spyder asks about installing Kite, you can install Kite.  It is an add on to Spyder that provides more in-depth help with Python commands.  '''Note:''' if you are using a Duke VCM to run Anaconda, you will not be able to install Kite.
  
 
==== MacOS Installation and Setup ====
 
==== MacOS Installation and Setup ====
 +
Same as Windows - if there are differences, please change this page or post a note on Ed!
  
==== Linux Installation and Setup ====
+
=== Your First Program! ===
 +
* Start a new file by clicking the New file icon at the top left.
 +
* Enter the code in the editing window (far left panel of Spyder) that says:
 +
<syntaxhighlight>
 +
print('Hello, world!')
 +
</syntaxhighlight> in the first line under the comments that were pre-loaded.
 +
* Save the file by clicking File and then Save.  Save it somewhere in your EGR103F23 Box folder as <code>start.py</code>.
 +
* Run the file by clicking the play button (single green arrow near the top of the screen; fifth icon from the left).  Clicking this button on a saved file will both change the Spyder working directory to the folder that file is in and will run the file.  If a box comes up asking about run settings, click the Run button.
 +
* Confirm that the Console window (bottom right panel in Spyder) now, among other things, says <code>Hello, world!</code>
  
=== Your First Program! ===
+
=== Your Second Program! ===
 
* Start a new file by clicking the New file icon at the top left.
 
* Start a new file by clicking the New file icon at the top left.
* Enter the code <code>print('Hello, world!')</code> in the first line under the comments that were pre-loaded.  
+
* Enter the code <syntaxhighlight lang=python>
* Save the file by clicking File and then Save.  Save it in your Box/EGR103F22 folder as <code>start.py</code>.
+
w = input("Word: ")
* Run the file by clicking the play button (single green arrow near the top of the screen).  Clicking this button on a saved file will both change the Spyder working director to the folder that file is in and will run the file.
+
print(w)</syntaxhighlight > in the first two lines under the comments that were pre-loaded.  
* Confirm that the Console window now, among other things, says <code>Hello, world!</code>
+
* Save the file by clicking File and then Save.  Save it somewhere in your EGR103F23 Box folder as <code>check.py</code>.
 +
* Run the file by clicking the play button (single green arrow near the top of the screen).  Clicking this button on a saved file will both change the Spyder working directory to the folder that file is in and will run the file.
 +
* The console window should show "Word: " -- click in the console window and then go ahead and type a word and then hit return; Python should print the word on the screen.  If Spyder crashes at this point, you have an older version of Spyder that somehow broke the <code>input</code> command - be sure to update your version!
  
 
=== Updating ===
 
=== Updating ===
 
To update Anaconda and the Spyder distribution within it, open the Anaconda Prompt and then type:
 
To update Anaconda and the Spyder distribution within it, open the Anaconda Prompt and then type:
 
  conda update conda
 
  conda update conda
  conda update anaconda
+
  conda update --all
conda update spyder
 
 
Unless you know of a specific reason not to, you can accept all the defaults.
 
Unless you know of a specific reason not to, you can accept all the defaults.

Latest revision as of 18:54, 23 August 2023

This is the Fall 2023 version of the installation page. It is written specifically for EGR 103 but works for other classes too - just change the Box folder when asked. At the start of the Fall 2023 semester, the following were the most up-to-date versions of things after installing and updating:

  • Anaconda 2023.7 with Python 3.11.4
  • Anaconda Navigator 2.4.2
  • Spyder 5.4.3
  • Jupyter Notebook: 6.5.4
  • Numpy 1.24.3
  • Scipy 1.11.1
  • Sympy 1.11.1
  • Matplotlib 3.7.1
  • Pandas 2.0.3
  • If you have previously installed Anaconda and need to update it, you can probably just open the Anaconda Prompt (Windows - go to Start/All Apps - Anaconda3 - Anaconda Prompt) or a Terminal (macOS - go to search and look for and start terminal) and type the following (accepting all prompts in between)
conda update conda
conda update --all

If you want to read more about keeping Anaconda and everything else up to date, read this blog post about Keeping Anaconda Up To Date


Descriptions

Anaconda describes its Anaconda Distribution as follows: "The open-source Anaconda Distribution is the easiest way to perform Python/R data science and machine learning on Linux, Windows, and Mac OS X. With over 15 million users worldwide, it is the industry standard for developing, testing, and training on a single machine, enabling individual data scientists to:

  • Quickly download 1,500+ Python/R data science packages
  • Manage libraries, dependencies, and environments with Conda
  • Develop and train machine learning and deep learning models with scikit-learn, TensorFlow, and Theano
  • Analyze data with scalability and performance with Dask, NumPy, pandas, and Numba
  • Visualize results with Matplotlib, Bokeh, Datashader, and Holoviews" Anaconda Distribution Landing Page

Anaconda describes Spyder as: "Spyder, the Scientific Python Development Environment, is a free integrated development environment (IDE) that is included with Anaconda. It includes editing, interactive testing, debugging and introspection features." Spyder Documentation

Installation

  • Go to https://www.anaconda.com/download and click the Download button if the correct version is listed just below it or pick the appropriate distribution from the "Get Additional Installers" section and download the package. You will want to use the graphical installer and almost definitely the 64-bit unless you know you have a 32-bit processor.
  • See specific instructions below depending on operating system

Windows Installation and Setup

  • As the installer runs:
    • You will need to agree to the license agreement
    • You should install for "Just Me" unless you know you have a reason not to
    • You can use the default installation folder unless you know you have a reason not to
    • For the advanced installation options, leave the defaults unless...you know...
    • Once done, it is up to you if you want to see the Anaconda Distribution Tutorial or Getting Started with Anaconda.
    • You are not required to register for Anaconda Nucleus, but can if you choose
  • Once installed, you will want to update everything.
    • Open the Anaconda Prompt (Windows - go to Start/All Apps - Anaconda3 - Anaconda Prompt) or a Terminal (macOS - go to search and look for and start terminal) and type the following (accepting all prompts in between)
conda update conda
conda update --all
  • Once installed and updated, start the Anaconda Navigator.
    • You do not need a cloud account, but you can create one if you want.
    • Once Navigator starts, it may say there is a new version. The current version installed and updates as of 8/23/2023 is 2.4.2. After that is there, the current versions of relevant packages will be:
      • Anaconda 2023.7 with Python 3.11.4
      • Spyder 5.4.3
      • Jupyter Notebook: 6.5.4
      • Numpy 1.24.3
      • Scipy 1.11.1
      • Sympy 1.11.1
      • Matplotlib 3.7.1
      • Pandas 2.0.3
  • In the Navigator window "Home" panel, there may be multiple items. One of them should be Spyder. Click on "Launch"
  • If Spyder asks about installing Kite, you can install Kite. It is an add on to Spyder that provides more in-depth help with Python commands. Note: if you are using a Duke VCM to run Anaconda, you will not be able to install Kite.

MacOS Installation and Setup

Same as Windows - if there are differences, please change this page or post a note on Ed!

Your First Program!

  • Start a new file by clicking the New file icon at the top left.
  • Enter the code in the editing window (far left panel of Spyder) that says:
print('Hello, world!')

in the first line under the comments that were pre-loaded.

  • Save the file by clicking File and then Save. Save it somewhere in your EGR103F23 Box folder as start.py.
  • Run the file by clicking the play button (single green arrow near the top of the screen; fifth icon from the left). Clicking this button on a saved file will both change the Spyder working directory to the folder that file is in and will run the file. If a box comes up asking about run settings, click the Run button.
  • Confirm that the Console window (bottom right panel in Spyder) now, among other things, says Hello, world!

Your Second Program!

  • Start a new file by clicking the New file icon at the top left.
  • Enter the code
    w = input("Word: ")
    print(w)
    
    in the first two lines under the comments that were pre-loaded.
  • Save the file by clicking File and then Save. Save it somewhere in your EGR103F23 Box folder as check.py.
  • Run the file by clicking the play button (single green arrow near the top of the screen). Clicking this button on a saved file will both change the Spyder working directory to the folder that file is in and will run the file.
  • The console window should show "Word: " -- click in the console window and then go ahead and type a word and then hit return; Python should print the word on the screen. If Spyder crashes at this point, you have an older version of Spyder that somehow broke the input command - be sure to update your version!

Updating

To update Anaconda and the Spyder distribution within it, open the Anaconda Prompt and then type:

conda update conda
conda update --all

Unless you know of a specific reason not to, you can accept all the defaults.