I successfully installed Python 3.8 on Windows 10 using Chocolatey through Windows PowerShell, which created a new directory at C:\Python38.
However, I later decided to install an older version of Python, so I uninstalled the current version using the following command:
choco uninstall python
After deleting the Python38 folder, I attempted to install Python 3.7 by executing the following command:
choco install python
Which gives me the following:
Chocolatey v0.10.15
Installing the following packages:
python
By installing you accept licenses for the packages.
Progress: Downloading python 3.7.3... 100%
python3 v3.7.3 [Approved]
python3 package files install completed. Performing other installation steps.
Installing 64-bit python3...
python3 has been installed.
Installed to: 'C:\Python37'
The install of python3 was successful.
Software installed as 'exe', install location is likely default.
python v3.7.3 [Approved]
python package files install completed. Performing other installation steps.
The install of python was successful.
Software install location not explicitly set, could be in package or
default install location if installer.
Chocolatey installed 2/2 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
However, upon inspecting my system, I could not find any evidence of C:\Python37
directory or any newly added Python files on my system despite the installation process. I searched my system thoroughly but found nothing.
To confirm the issue, I attempted to reinstall Python 3.8 using Chocolatey, and although the installation process appeared to be successful and showed that it was installed to ‘C:\Python38
‘, I was unable to locate it on my hard drive.
2 Answers
Introduction
Python is a popular programming language used for developing various applications such as web applications, desktop applications, scientific computing, and more. It is available for different operating systems such as Windows, Linux, and macOS. In this blog post, we will focus on installing Python 3.8 on Windows 10 PowerShell using Chocolatey, a package manager for Windows.
Installing Python 3.8 on Windows 10 PowerShell using Chocolatey
Python 3.8 can be easily installed on Windows 10 PowerShell using Chocolatey. Follow the steps below to install Python 3.8 on your system:
1. Open Windows PowerShell as an administrator.
2. Install Chocolatey by running the following command:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
3. Once Chocolatey is installed, run the following command to install Python 3.8:
choco install python --version 3.8.0
4. Wait for the installation to complete. Once the installation is complete, you can verify the installation by running the following command:
python --version
5. If Python 3.8 is installed successfully, you should see the version number displayed in the output.
Uninstalling Python using Chocolatey
If you want to uninstall Python using Chocolatey, follow the steps below:
1. Open Windows PowerShell as an administrator.
2. Run the following command to uninstall Python:
choco uninstall python
3. Wait for the uninstallation process to complete.
4. If you want to remove the Python installation folder, you can do so by navigating to the folder and deleting it manually.
Reinstalling Python using Chocolatey
If you want to reinstall Python using Chocolatey, follow the steps below:
1. Open Windows PowerShell as an administrator.
2. Run the following command to reinstall Python:
choco install python --version 3.8.0
3. Wait for the installation to complete.
4. Verify the installation by running the following command:
python --version
5. If Python 3.8 is installed successfully, you should see the version number displayed in the output.
Troubleshooting Chocolatey Installation
If you encounter issues with installing Python using Chocolatey, you can try the following troubleshooting steps:
1. Check if you have the latest version of Chocolatey installed. You can do this by running the following command:
choco upgrade chocolatey
2. Check if you have the latest version of PowerShell installed. You can do this by running the following command:
$PSVersionTable.PSVersion
3. Make sure that you are running PowerShell as an administrator.
4. Check if you have any antivirus software that may be blocking the installation process. You can try disabling the antivirus temporarily and see if the installation works.
5. If the above steps do not work, you can try installing Python manually by downloading the installer from the official Python website and running it.
Conclusion
Chocolatey is a convenient package manager for Windows that can be used to install Python and other software packages. In this blog post, we covered how to install Python 3.8 on Windows 10 PowerShell using Chocolatey, how to uninstall Python using Chocolatey, how to reinstall Python using Chocolatey, and some troubleshooting steps if you encounter issues with the installation process. We hope this blog post was helpful in getting Python up and running on your Windows 10 system.
I encountered a similar problem that I resolved by deleting the directories:
C:\ProgramData\chocolatey\lib\python
C:\ProgramData\chocolatey\lib\python3
Python installation through choco was successful only after I deleted these folders, although the installation process took considerably longer.