Here we discuss two ways to set up Python, one is using the graphical installation wizard and the other is with the help of prompt or Powershell (Terminal) command in .
Using the graphical user interface:
As we all know, by default, Python is not included in Windows to compile our based its program. So, visit the official website python.org and download the latest version by clicking the"Download"button.
After completing the previous steps, you will already have the python executable file on Windows.
To confirm that the installation was successful without any errors, let’s check the versions of Python and PIP installed. To do this, you can use Command Prompt or Powershell.or, we can also run Python Terminal application to issue commands as in your Windows search type -pythonappears as its application and then click to open it. You will also have a Python interpreter with version details.
python --version
Check PIP version
pip -V
Note: If you type python on the command terminal or Powershell, open the Microsoft Store, and then follow the next step.
By default, if you type python in the command prompt or type PowerShell in Windows, it will Open the Microsoft Store to download another version of Python instead of using the existing one. To stop it and tell the system to run the one you installed, follow these steps:
#Use command line mode
Right-click theWindows Start buttonand selectTerminal(Administrator). If you have PowerShell, you can do this too.
When you do a command line installation, there are multiple versions available for installation. We can useWingetto first check what they are before installing them.
winget 搜索 Python.Python
一旦您决定了哪个版本适合您的项目,然后使用以下语法进行设置。
winget install Python.Python.version-number
例如,如果你想要3.11那么命令将是这样的:
winget install Python.Python.3.11
完成后,关闭您的 CMD 终端或 PowerShell,然后再次重新打开它以检查它是否正常工作。
为此,要么使用:
pip -Vor python --version
打开 Python 命令行并键入:
print ('Hey I am here with Python')
上面的代码将在您的屏幕上打印“嘿,我在这里使用 Python”。
The above is the detailed content of 2 ways to install the latest Python on Windows 11 or 10 - GUI and CMD. For more information, please follow other related articles on the PHP Chinese website!