Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Analysis of python3.6 instance of linux compilation and installation

Shulou Source: shulou.com Published: 2022-05-31 11:24:09 09月23日 Update

This article mainly introduces "linux compilation and installation python3.6 instance analysis". In daily operation, I believe many people have doubts about linux compilation and installation python3.6 instance analysis. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "linux compilation and installation python3.6 instance analysis". Next, please follow the editor to study!

1. First, go to the official website to download gzipped source tarball.

Do not download "xz compressed source tarball". The name of the latest python3.6 package is: python-3.6.7.tgz. Put the downloaded package anywhere, or you can put it on the desktop (it is easy to delete the installation package and unzip the installation package after installation).

two。 Change the command line to the directory where the compressed file is located above (such as the desktop), and type tar-xzf python-3.6.7.tgz

Here tar means decompression,-x means to release the file from the archive file, z means to extract it with gzip (for xx.tgz and xx.tar.gz format), and f is followed by the name of the compressed file.

3. Change the command line directory to the unzipped folder, the python-3.6.7 folder. Then execute. / configure.

The purpose of this command is to generate makefile files for use by the next make command, makefile files are stored in build order, and linux build program components need to be in the order specified by makefile.

4. Execute make

The role of make is to mutate the source code and generate execution files.

Execute make install

Make install copies the generated execution files to the necessary directories in the linux system, such as to the usr/local/bin directory, so that all users can run the program.

At this point, the installation of python is complete, and the installation of other linux software is more or less the same, basically the process of configure > make > make install.

Execute which python to view the installation directory of python. The python that comes with linux and the python we installed are stored in this directory. But when we enter python on the command line, we find that we are entering the old version of python that comes with linux. If we want to enter the new version of python, we need to type python3 on the command line.

Check whether the installation is successful: enter python3, enter shell mode, and enter a line of code:

Print ("hello world")

The contents of the string are output.

To view the installation location: go to shell and type

Import sysprint (sys.path) at this point, the study on "linux compilation and installation python3.6 instance analysis" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: File input command directory instance instance analysis analysis compilation learning generation action copy folder more desktop program order switch storage help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Xiaomi Huawei MariaDB Docker