Install the python2.7 development environment that is no longer supported

Install python development environment


Python2 was officially announced to stop updating and maintaining on January 1, 2020. But there used to be many classic programs embedded python2 in the project. So even if python2 has exited the stage, it is still necessary to understand how to install its operating environment.
In terms of development, some people still use python2.

python2.7 install pip

Python 2.7.9 + or Python 3.4+ and above have their own pip tool.
Those who dislike the trouble of manually installing pip and want to use Python2 can download the version above python2.8.
The best is python2.7.16.
But if there is no pip under python2.7, how to install it? The pip installation package installation depends on the setuptools library.
Setuptools official website download address: https://pypi.org/project/setuptools/
pip official website download address: https://pypi.org/project/pip/

python2.7支持的pip版本一定要低于20.3,否则没法使用pip install

After downloading, there is the following directory:
Insert picture description here
the pip-9.0.1 shown in the figure above is the downloaded offline version of pip, unzip it to pythonLib\site-packages directoryDown and open to execute cmd

 python.exe setup.py install

Found that the dependency library setuptools library is missing, similarly download the setuptools offline package and unzip it and execute this command to install it successfully.
Use pip --version to check whether pip is installed normally and the installed version.
The sign of successful pip installation is the presence of the pip.exe process in the Scripts folder of python.

The main function of setuptools is to install other third-party python packages
. The main function of pip is to use pip install librarycommands to download libraries that are missing in the current environment.
pip is an improved version of easy_install, providing better prompts, deleting packages and other functions. There is only easy_install in the old version of python, not pip. (In what age are you using such an old version of python, let me talk about it here, because there are many other online tutorials that use easy_install)

Install Pylint

In addition, if there are development needs or code inspection needs, you can download another pylint.
pylint is mainly used to check the correctness and standardization of the code and prevent obvious grammatical errors. It is also a specification check of the uploaded code.
Insert picture description here
If there is no pylint, VScode will always pop up the picture on the window. But python2.7 no longer supports downloading pylint.

The pylint of python3.8 installed in the figure below.

 python.exe -m pip install -U "pylint<2.0.0" --user

Insert picture description here
In addition to pylint,SonarLintIt is also a code style checking tool that should be merged.

Guess you like

Origin blog.csdn.net/qq_43312649/article/details/107063129