[Installation package attached] Detailed tutorial on installing the latest version of Python in 2023! One-click installation, permanent use

1. python official website

The official Python website mainly includes python's About, Downloads, Documentation, Community, Success Stories, News, Events and other columns.

Python official website address: https://www.python.org/

[See the end of the article for how to receive it]

2. In the Downloads column of the official website, select the corresponding operating system

Open the Python official website address above, as shown in the picture below, put the mouse into the Downloads column of the web page, and select the windows operating system inside.

picture

3. Enter the page corresponding to windows and select the python version

(1) Select the stable release version of python, Stable Releases

Click to enter the page corresponding to the Windows operating system to display the Python installation version. These Python installation versions are suitable for the Windows operating system.

picture

The left side of the picture above shows the stable release version Stable Releases, and the right side shows the pre-release version Pre-releases. The former is a tested, relatively complete and stable version, while the latter is still under testing and may not be perfect. Therefore, we download the stable release on the left VersionStable Releases.

(2) Download the python installation program Windows Installer

picture

The Windows embeddable package in the red box in the picture above is the Windows embeddable package of python. After decompression, it is a folder. This folder is a minimum python operating environment, excluding doc, idle, pip, etc. This version is mainly used for embedding into other programs.

In the picture above, 32-bit refers to the 32-bit operating system. The downloaded package is suitable for 32-bit operating systems and is based on 32-bit processors. ARM64 is the processor architecture in the AArch64 state. The downloaded package is suitable for ARM64 processors and is based on 64-bit processors.

64-bit refers to a 64-bit operating system, based on a 64-bit processor. The downloaded package is suitable for 64-bit operating systems. Right-click My Computer and left-click Properties in the menu to view the hardware configuration of your computer. The type of your computer's operating system is shown in the red box in the figure below.

picture

Since the Windows embeddable package is a simplified version of python, it is mainly used to embed other applications. We use python for program development and need to download the Windows Installer installation program. This installer has a relatively complete python development environment. The installation program of Python's Windows Installer is shown in the red box in the figure below.

According to the number of bits of your computer's operating system, choose to download the python installer Windows Installer corresponding to the red box in the picture above. Nowadays, 64-bit operating systems are generally used, and download the Windows installer (64-bit) in the red box in the picture above.

4. Run the installation program Windows Installer to install python

(1)Choose custom installation

The Windows operating system allows the creation of multiple account users. Each account has its own usage rights. Install Now defaults to the current account installation. The installation path and content are default. Other non-administrator accounts cannot log in to the Windows system and use the Python installed by this account. .

picture

Use admin privileges when installing py.exe

Check this item to install the python executable program with administrator rights. In the Windows system, the administrator account Administrator has the highest access rights and has the authority to access other accounts.

Add python.exe to PATH

Check this item to add python to the system path of windows to facilitate automatic recognition by the operating system.

The default installation of python in the picture above will automatically install additional IDLE, pip, Documentation, Creates shortcuts and file

associations (create shortcuts in the start menu, create file associations). The default installation installs relatively basic content, but already has basic python development functions. If you want to reduce or increase functions, or specify the installation path, you can choose a customized installation.

Usually we choose custom installation, which can add more functions. The Customize installation in the red box in Figure 4-2 is a custom installation. Below we choose custom installation.

picture

Check Use admin privileges when installing py.exe and Add python.exe to PATH, click Customize installation to enter custom installation, and enter the python optional function setting interface shown in the figure below.

(2) Optional Features Settings

picture

Documentation

Install the python offline documentation file, which is usually the python instruction manual. This option is optional.

pip

Installing pip can install libraries external to Python in the cmd command window. Check this option. After installation, you can start it by win+r

In the run window, enter cmd, enter pip install library name in the cmd command window, and the library can be automatically downloaded and installed. Enter pip unstall library name to uninstall this library. Use pip in the default path of the cmd command window to install or uninstall the library. Generally, it is installed in the Lib→site-packages folder under the python path. Uninstallation also uninstalls the library in the Lib→site-packages folder under the python path.

tcl/tk and IDLE

Install tkinter and IDLE development environment. Whether to check this option depends on your needs. The Tkinter module is an interface to Python's standard Tk GUI toolkit. The tkinter module can create GUI applications. IDLE is Python's integrated development and learning environment. Its full name is Integrated Development and Learning Environment. It is a visual shell command line and a simple command running window. After installation, an IDLE shortcut is generated in the computer start menu (lower left corner of the windows desktop). .

Python test suite

Install Python's standard library test suite, which can be used to execute written test cases to test whether the written classes and methods meet expectations. Whether this option is checked can be determined according to needs.

py launcher

Launcher is a Python launcher for Windows, which can help us locate and execute different Python versions. This option is checked.

for all users (requires admin privileges), the launcher (launcher) is available to all windows accounts. Administrator privileges have been checked in the installation settings above. Whether this option is checked or not depends on the needs.

You can check all the options in the picture above, click next to enter the python advanced option setting interface shown in the picture below.

(3)Advanced Options

picture

Install Python 3.11 for all users

It is available for all Windows accounts. Whether this item is checked or not can be determined according to the needs.

Associate files with Python(requires the 'py'launcher)

File association, associate files with .py suffix to Python (you need to install the python launcher launcher), check this option.

Create shortcuts for installed applications

Create shortcuts for installing applications. The created shortcuts will be displayed in the start menu. Check this option.

Add Python to environment variables

Add python as the system environment variable and check this option. After checking Add python.exeto PATH in the previous step, this item is automatically checked.

An environment variable is an object with a specific name in the operating system that contains information that will be used by one or more applications. When the system is asked to run a program without telling it the full path where the program is located, in addition to looking for the program in the current directory, the system will also go to the path specified in path to find runnable variables.

Precompile standard library

Precompile the standard library and Python program preprocessing. The precompiled program will run faster. It is the first work to be done in the entire compilation process. This option is checked.

Download debugging symbols

Download debugging symbols. Debugging symbols can help debug the program and record the relationship between symbols such as variables and functions and memory location. Whether this option is checked can be determined according to needs.

Download debug binaries(requires VS 2017 or later)

Download the debugging binary file (VS 2017 needs to be installed. VS is a powerful development tool launched by Microsoft). Whether this option is checked depends on the needs.

Customizeinstall location

Customize the installation path, you can specify the path to install python.

In the picture above, you can check according to your own needs. Here, check the first five items, specify the installation path, and then click Install to enter the python installation progress interface shown in the picture below.

(4)Installation

picture

After the installation progress in the picture above is completed, the prompt interface of successful python installation shown in the picture below appears. At this point, python has been installed.

picture

The picture above indicates that the python installation is complete. Click Close. The python installation is complete and the computer can use python.

5. Python development environment tools

After we install python, there will be a python.exe file in the directory in the installation path. This file is a python interpreter. Its function is to convert python code into bytecode and execute it. If we want to program in python, we need to use development tools.

IDLE is an integrated development environment for python programs. It is the integrated development environment that comes with python, which is also the development tool of python. IDLE is checked in the above installation steps. After installation, an IDLE shortcut will be generated in the computer start menu (lower left corner of the Windows desktop).

We can use the IDLE tool for python development, but the IDLE tool is more suitable for running and debugging some simple small programs, and is not suitable for project development.

In order to improve project development and management efficiency, we can use the PyCharm tool for python language development. PyCharm is a Python IDE (Integrated Development Environment, integrated development environment).

PyCharm comes with a set of tools that can help us improve the efficiency of Python language development. PyCharm provides code editing, debugging, syntax highlighting, project management, code jumps, smart prompts, auto-complete and other functions to help us write python code more efficiently (that is, python project development).

The Python installation package and video tutorial have been packaged for everyone.  Go to GZH below.

Guess you like

Origin blog.csdn.net/weixin_49889351/article/details/132829927