How do i update python on windows?
Installing/Upgrading Python Using the Chocolatey Windows Package ManagerLet's say you have Python 2.7.16: Show
...and you want to upgrade to the (now current) 3.x.y version. There is a simple way to install a parallel installation of Python 3.x.y using a Windows package management tool. Now that modern Windows has package management, just like Debian Linux distributions have apt-get, and RedHat has dnf: we can put it to work for us! It's called Chocolatey. What's Chocolatey?Chocolatey is a scriptable, command line tool that is based on .NET 4.0 and the nuget package manager baked into Visual Studio. If you want to learn about Chocolatey and why to use it, which some here reading this might find particularly useful, go to https://chocolatey.org/docs/why Installing ChocolateyTo get the Chocolatey Package Manager, you follow a process that is described at https://chocolatey.org/docs/installation#installing-chocolatey, I'll summarize it for you here. There are basically two options: using the cmd prompt, or using the PowerShell prompt. CMD Prompt Chocolatey InstallationLaunch an administrative command prompt. On Windows 10, to do this:
If you don't have administrator rights on the system, go to the Chocolatey website. You may not be completely out of luck and can perform a limited local install, but I won't cover that here.
Chocolatey will be downloaded and installed for you as below:
Either Exit the CMD prompt or type the following command to reload the environment variables:
PowerShell Chocolatey InstallationIf you prefer PowerShell to the cmd prompt, you can do this directly from there, however you will have to tell PowerShell to run with a proper script execution policy to get it to work. On Windows 10, the simplest way I have found to do this is to type the following into the Cortana search bar next to the Windows button:
Next, right click on the 'Best Match' choice in the menu that pops up and select 'Run as Administrator' Now that you're in PowerShell, hopefully running with Administrator privileges, execute the following to install Chocolatey:
PowerShell will download Chocolatey for you and launch the installation. It only takes a few moments. It looks exactly like the CMD installation, save perhaps some fancy colored text. Either Exit PowerShell or type the following command to reload the environment variables:
Upgrading PythonThe choco command is the same whether you use PowerShell or the cmd prompt. Launch your favorite using the instructions as above. I'll use the administrator cmd prompt:
Essentially, chocolatey will tell you "Hey, Python isn't installed" since you're coming from 2.7.x and it treats the 2.7 version as completely separate. It is only going to give you the most current version, 3.x.y (as of this writing, 3.7.2, but that will change in a few months):
Either exit out of the cmd/Powershell prompt and re-enter it, or use refreshenv then type py --version
Note that the most recent Python install will now take over when you type Python at the command line. You can run either version by using the following commands:
From here I suggest you use the Python pip utility to install whatever packages you need. For example, let's say you wanted to install Flask. The commands below first upgrade pip, then install Flask
...will do the trick. Happy Pythoning! How do I update Python to latest version?Updating to a new Python version is easy on a computer running Windows. All you have to do is visit the Python downloads page and download the latest version. Clicking on the button will replace the existing version of Python with the new version. The older version will be removed from your computer.
How do I update Python software?To upgrade Python on Windows, download the installer or search for the app in the Microsoft Store.. Go to Microsoft Store and type Python in the search field.. Select Python 3.9 from the search results that appear.. Click the Get button to start the installation.. How do I manually update Python?x.y to 3. x.z (patch) Python version, just go to Python downloads page get the latest version and start the installation. Since you already have Python installed on your machine installer will prompt you for "Upgrade Now". Click on that button and it will replace the existing version with a new one.
How do I update Python to 3.8 in CMD?With the command line open, type in the following command and press Enter :. C:\> python --version Python 3.8.4.. C:\> python -V Python 3.8.4.. C:\> where.exe python C:\Users\mertz\AppData\Local\Programs\Python\Python37-32\python.exe.. |