python-install python3.7 under the virtual machine

Installation environment: rhel7 virtual machine
Reason for installation: At present, the interpreter version has reached 3 and above, so I want to install a newer version of the interpreter.
Insert picture description here
Insert picture description here
To install python3 and above, you need to download the source code installation package on the official website. It is recommended to download the stable version. After downloading, install the package as follows: After the
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
above compilation process is completed, then install python3.
Insert picture description here
During the installation, an error occurs: after
Insert picture description here
Insert picture description here
installing zlib-devel, install python3 again.
Insert picture description here
Now let's try to run the python3 program,
Insert picture description here
Insert picture description here
but if you use the above method every time you run python3, it will be very troublesome. For convenience, we will add python3 to the environment variables, so that directly input python3 directly in the shell Run python3 program directly.
Insert picture description here

Published 35 original articles · praised 0 · visits 1402

Guess you like

Origin blog.csdn.net/qq_44749796/article/details/105567939