Python (British pronunciation: /ˈpaɪθən/; American pronunciation: /ˈpaɪθɑːn/) is a programming language invented by the Dutchman Guido van Rossum. It is now the most popular programming language in the world, and it also has the largest number of users. Python stresses code readability and simple syntax. Compared with C, C++, Java, and other programming languages that are also very influential, Python lets users use less code to express their ideas. Below are the rankings of Python given by several authoritative programming language rankings. The first picture is from TIOBE Index, and the third picture is from IEEE Spectrum. The second picture is especially worth mentioning. It shows how popular programming languages are on GitHub, the world's largest code hosting platform. In the most recent four years, Python has taken first place there.
Below are some important time points in the development of Python:
- December 1989: Guido van Rossum decided to develop a new scripting language and its interpreter to pass a boring Christmas holiday. The new language would be the successor to the ABC language, and it would mainly be used to replace Unix shell and the C language to do system management. Because Guido himself was a loyal fan of the BBC TV series Monty Python's Flying Circus, he chose the word Python as the name of the new language.
- February 1991: Guido van Rossum released the earliest code of the Python interpreter on the
alt.sourcesnewsgroup, marked as version0.9.0. - January 1994: Python
1.0was released. This was the place where the dream began. - October 2000: Python
2.0was released. The whole development process of Python became more open, and the ecosystem slowly began to form. - December 2008: Python
3.0was released. It introduced many new features from modern programming languages, but it was not fully backward compatible. - April 2011:
pipwas released for the first time, and Python had its own package management tool. - July 2018: Guido van Rossum announced that he was taking a "permanent vacation" from the position of "Benevolent Dictator For Life" (the person who has the final decision when there is a dispute in an open-source project community).
- January 2020: After Python 2 and Python 3 lived together for 11 years, the official team stopped updating and maintaining Python 2, and hoped users would switch to Python 3 as soon as possible.
- At present: Python has been widely used in large models (GPT-3, GPT-4, BERT, and so on), computer vision (image recognition, object detection, image generation, and so on), intelligent recommendation (YouTube, Netflix, ByteDance, and so on), autonomous driving (Waymo, Apollo, and so on), speech recognition, data science, quantitative trading, automated testing, automated operations, and other fields. The ecosystem of Python is also quite prosperous.
Note: The version number of most software is usually divided into three parts, in the form
A.B.C. Here,Ameans the major version number.Aincreases only when the software is rewritten and upgraded as a whole, or when a backward-incompatible change appears.Bmeans a feature update.Bincreases when a new feature appears.Cmeans a small change (for example, fixing a bug). As long as there is a change,Cincreases.
Python has many advantages. Here I will simply list a few for everyone.
- It is simple and elegant. Compared with many other programming languages, Python is easier to get started with.
- It can use less code to do more things, and improve development efficiency.
- It is open source, and it has a powerful community and ecosystem.
- It can do very many things, and it has very strong adaptability.
- It is a glue language, and it can stick together things developed in other languages.
- It is an interpreted language, so it is easier to work across platforms, and it can run on many operating systems.
Python's biggest disadvantage is low execution efficiency (this is a common problem of interpreted languages). If you care more about code execution efficiency, C, C++, or Go may be a better choice for you.
If a worker wants to do his job well, he must first sharpen his tools. If you want to start your Python programming journey, you first need to install the Python environment on your computer. Simply speaking, this means installing the Python interpreter needed to run Python programs. We recommend that everyone install the official Python 3 interpreter. It is written in C, and we also usually call it CPython. It may be your best choice right now. First, we need to find the download link on the official downloads page. After clicking the "Download" button and entering the download page, you need to choose a suitable Python 3 installer according to your operating system, as shown in the picture below.
After entering the download page, some Python versions do not provide installers for Windows and macOS. They only provide compressed source code files. For friends who are familiar with Linux, we can build and install from source code. For friends who use Windows or macOS, we still strongly recommend using the installer. For example, if you want to install Python 3.10, then choosing Python 3.10.10 or 3.10.11 will let you find the installation package for Windows or macOS. Other versions may only have source code, as shown in the picture below.
Below we use Windows 11 as an example to explain how to install the Python environment on the Windows operating system. Double-click and run the installer downloaded from the official website, and an installation wizard will open, as shown in the picture below.
First, you must remember to check Add python.exe to PATH. It will help us add the Python interpreter to the PATH environment variable of the Windows system. If you do not understand it, that is okay, just check it. Second, Use admin privileges when installing py.exe is for getting administrator permission during installation, and it is recommended to check it. Then we choose Customize Installation and use custom installation mode. This is the choice of professionals, and you are that professional, or at least you can pretend to be that professional. We do not recommend using Install Now (the default installation).
Next, the installation wizard will ask you to check the needed Optional Features. Here we can directly check all of them. One thing worth mentioning is the second item. It is Python's package management tool pip, and it can help us install third-party libraries and third-party tools, so you must remember to check it. Then click Next to enter the next step.
Next is choosing Advanced Options. Here we recommend that everyone check only Add Python to environment variables and Precompile standard library. The first one will help us automatically set the environment variables well. The second one will precompile the standard library (generate .pyc files), so it will not need temporary compilation when we use it later. The same sentence again: if you do not understand it, that is okay, just check it. For Customize install location below, we strongly recommend changing it to a custom path. This path should not contain Chinese characters, spaces, or other special characters. Paying attention to this point will reduce a lot of unnecessary trouble for you in the future. After the setting is done, click Install to start the installation.
If the installation succeeds, the screen shown below will appear. The key word for successful installation is successful. If installation fails, the word here will become failed.
After the installation is finished, you can open Windows Command Prompt or PowerShell, and then enter python --version or python -V to check whether the installation succeeded. This command is used to view the version number of the Python interpreter. If you see the screen shown below, then congratulations, the Python environment has been installed successfully. Here we also recommend checking whether Python's package management tool pip is available. The corresponding command is pip --version or pip -V.
Note: If the installation process reports an error or says installation failed, it is very likely that your Windows system is missing some dynamic-link library files or some necessary build tools. You can download
Visual Studio 2022 Build Toolsfrom the Microsoft website to fix it, as shown in the picture below. If it is not convenient to download from the Microsoft official website, you can also use the following Baidu Netdisk link to get the repair tool:https://pan.baidu.com/s/1iNDnU5UVdDX5sKFqsiDg5Q, extraction code:cjs3.![]()
The
Visual Studio 2022 Build Toolsdownloaded above need an internet connection before they can run. After running them, the screen shown below will appear. You can follow the picture below and check the corresponding options to do the repair. The repair process needs to download the corresponding software packages from the internet, and this process may take a long time. After the repair succeeds, it may ask you to restart your operating system.![]()
Installing the Python environment on macOS is simpler than on Windows. The installation package downloaded from the official website is a pkg file. After you double-click and run it, you can keep clicking Continue, and the installation will succeed. You almost do not need to set anything or check anything, as shown in the picture below.
After installation is finished, you can enter the command python3 --version in macOS Terminal to check whether installation succeeded. Please note that the command here is python3, not python!!! Then let us check the package management tool again and enter pip3 --version, as shown in the picture below.
Some people may recommend that beginners directly install Anaconda, because Anaconda will help us install the Python interpreter and some commonly used third-party libraries. Besides that, it also provides some convenient tools, and it is especially suitable for complete beginners. I personally do not recommend this way, because when you install Anaconda, you will somehow install a large pile of third-party libraries, whether they are useful or not, and they take up quite a lot of disk space. Then your terminal or command prompt will be changed by Anaconda (it automatically activates the virtual environment every time it starts). These things do not match the principle of least astonishment in software design. I will not say more here about Anaconda's other small problems. If you really want to use Anaconda, I recommend Miniconda. It is on the same download page as Anaconda.
Complete beginners also often hear or say, "I want to write Python programs. Isn't it enough if I install PyCharm?" Here let me simply explain it. PyCharm is only a tool that helps write Python code. It itself does not have the ability to run Python code. What runs Python code is the Python interpreter that we installed above. Of course, some versions of PyCharm will also ask you to download the Python interpreter from the internet when you create a Python project and it cannot detect a Python environment on your computer. We will put the installation and use of PyCharm in the next lesson.
Let us summarize what we learned:
- Python is a very powerful language. It can do many things, so it is worth learning.
- To use Python, you must first install the Python environment, that is, the Python interpreter needed to run Python programs.
- On Windows, you can enter
python --versionin Command Prompt or PowerShell to check whether the Python environment was installed successfully. On macOS, you can enterpython3 --versionin Terminal to do the check.












