Anaconda is a collection of software packages that contains a base Python engine plus over 500 compatible Python packages. You need to install Anaconda Python before you can install the PyTorch or Keras/TensorFlow neural network code libraries. See the links at the bottom of this blog post for install guides for PyTorch and Keras/TensorFlow after you install Anaconda Python.
Prerequisites: A machine with a relatively modern CPU (no older than 8 years old) running Windows 10 or 11. You must be logged on as a user with full administrative privileges and be connected to the Internet. You can check if you have admin privileges by launching a command shell (cmd) and typing the command “net user” (without the quotes). This will show you your current user name. Then type the command “net user the_name” and look for the Local Group Memberships entry – it should read “Administrators”.
1. Delete current Python installations. Open the Windows Control Panel | Programs and Features, and delete any existing Anaconda installations and any existing standalone Python instances. You may have several different versions of Python installed because many programs install Python without asking. Note: In theory you can use PyTorch and Keras/TensorFlow with multiple versions of Python on your machine, but you need to have advanced skill to prevent software collisions and incompatibilities. The Python Launcher program can manage multiple Python installs.
2. At this point you have no Python and no Python packages on your machine.
3. Do an Internet search for “anaconda archive” to find old versions of Anaconda. The URL when I wrote this post was https://repo.anaconda.com/archive/ but it could change. Locate the installer file for Windows, 64-bit, Anaconda3 version 2020.02 — be careful, it’s very easy to get the wrong file. It’s Anaconda3-2020.02-Windows-x86_64.exe. Right-click and download the file to your local machine to any convenient directory (Desktop is fine). Then, after downloading, double-click on the .exe executable installer file to start installation.
4. You will see a Welcome screen. Triple or quadruple check that you have the correct version. Click “Next”.
5. You will see a License Agreement. Click “I Agree”.
6. You will see Installation Type. Accept the default “Just Me”. Note: The “All Users” option works fine too in most cases.
7. You will see Installation Location. Accept the default. This will vary depending on whether you are logged on as a network user or a local user. The location is usually C:\Users\(user)\Anaconda3. You should write this location down because everything, including later PyTorch and Keras/TensorFlow libraries, goes here.
8. On the next screen you should check the box labelled “Add Anaconda to my PATH environment variable” in spite of the red warning message. Then click the “Install” button. Note: If you don’t add to the PATH here, you’ll have to do it manually later which requires advanced skill.
9. The installer will unzip thousands of files and then install them. The process takes 10-20 minutes. If you want, you can click on the “Details” button or you can just watch the green progress bar.
10. Eventually you will see an Installation Complete screen. Click “Next”.
11. You will see a screen that presents some marketing information. Click the “Next” button. Note: The marketing information often changes.
12. You will see a screen that has checkboxes for more information, and possibly options to install other software. Do not install anything else. Uncheck all options and click the “Finish” button.
13. Python should now be installed. To test, open a command shell. Navigate to your root directory by typing “cd \” and hitting (Enter). Next type “python” (without the quotes). You should see the Python version 3.7.6 and the double-greater-than interactive prompt. Type “exit()” and hit (Enter).
Note: The Python engine requires the Microsoft Visual C++ (MSVC) redistributable runtime library packages in order to work. You will almost certainly already have this on your machine because it’s used by almost every Microsoft application. If you try to launch Python and get an error about MSVC, it probably means you have a brand new machine. The error message will give the URL where you can download MSVC to your machine, and then you can install it.
Congratulations! You have successfully installed Anaconda3 Python 3.7.6 on your machine.
The next steps are to install PyTorch, and/or Keras with TensorFlow.
See https://jamesmccaffrey.wordpress.com/2022/05/10/installing-pytorch-1-10-0-on-windows-10-11/ for installing PyTorch 1.10.0
See https://jamesmccaffrey.wordpress.com/2022/05/10/installing-keras-2-8-0-on-windows-10-11/ for installing Keras 2.8.0
Pingback: Preparing a Machine for the 2022 Predictive Analytics World All-Day Workshop | James D. McCaffrey
Pingback: Precisión de clasificación de clases múltiples por clase usando PyTorch — Visual Studio Magazine – Psydyrony