Updating Your Software - IncrediCoders/Python1 GitHub Wiki
This page walks you through updating the following software:
1. Visual Studio Code
By default, Visual Studio Code (VSC) is set to auto-update for macOS, Windows, and Linux users. Whenever a new release is available, VSC will immediately update itself the next time you launch the program.
Additionally, by default VSC will auto-update any extensions, when newer versions become available.
2. Python
If you would like to update Python to the latest version, navigate to Python.org.
NOTES: We recommend uninstalling your older versions of Python on your system before installing the newest version. Also, sometimes the Download Python button (on the Python Downloads page) sends you to the release notes instead of downloading Python. Refresh the Downloads page, and try again.
This page will always have the latest version of Python, and it automatically selects the operating system (such as Windows, Mac, or Linux) that you are using. For other operating systems, click the appropriate link below the yellow button. You will be taken to a new page that has the list of releases. Locate the most recent version.
Windows and macOS
From there, you can follow the directions back on the Install Visual Studio, Python, and Pygame page to download the new version of Python.
Linux
Linux automatically updates with the latest version of Python. However, you can manually update it yourself.
- Open up a Terminal in VSC.
- Once you have a Terminal open, enter the following commands:
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
- Replace the X with the most recent version available:
sudo apt install pythonX
NOTE: To check the most recent version, click here. The Python download page will have the newest version number on the yellow button.
If You Have Multiple Versions of Python
Sometimes a terminal runs older versions of Python (not the latest version that you have installed). As we mentioned above, we recommend you uninstall older versions of Python. However, if you are unable to do so, here are a few steps you need to take in VSC to make sure it chooses the most recent version of Python when you run your code:
- Locate the Status Bar on the bottom of the VSC window. It displays important information about your workspace, including the interpreter you are using for Python.
- Click on the section that starts with
Python
, and it will bring up a drop-down menu with the available Python interpreters. Verify the most recent version is selected. - If you had VSC Terminal open before downloading a newer version of Python, close the VSC Terminal tab.
NOTE: The VSC Terminal will be run in the older version of Python and can cause errors while running your code.
- Open up a new Terminal. (Click Terminal in the file menu at the top of VSC, to open a new Terminal tab.) It will now run your programs using the most updated version of Python.
NOTE: This same issue has been found in other terminals, such as the Mac Terminal and the Linux Terminal. We recommend you run the commands in the VSC Terminal.
3. Pygame
Make sure you have the latest version of Pygame, to avoid various compatibility issues. In order to update your version of Pygame, you will need to uninstall the current version and then download the newer one. Follow these steps:
- In a Terminal in VSC, type and enter the following command:
pip uninstall pygame
.NOTE: If you see a "pip: command not found," error, then try running the code as
pipX uninstall pygame
(where "X" is the version number, likepip3
). - A long list of files related to the
pygame
module will show up, and there will be a prompt confirming uninstallation. Entery
for "yes" and Pygame will finish uninstalling. - From there, you can follow the directions back on our installation page (Install Visual Studio, Python, and Pygame), to download the newest version of Pygame.
Next Steps
If you are still setting up, head back to the Install Visual Studio, Python, and Pygame page, to continue setting up your software.
If you are all done with setup, next you'll download all the code files and images that you're going to use to create your programs and games! It's all free and available on GitHub.
Click here to learn how to download and open the IncrediCoders files into Visual Studio Code.
Otherwise, head to the main resources page for this book.