Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Python3 in Centos7 environment

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the Centos7 environment how to install Python3 related knowledge, the content is detailed and easy to understand, simple and fast operation, has a certain reference value, I believe you will have something to gain after reading this Centos7 environment how to install Python3, let's take a look.

Because python2 is already installed in centos7, and this python2 cannot be deleted, because there are many system commands, such as yum.

[root@vm_105_217_centos python-3.6.2] # pythonpython 2.7.5 (default, aug 4 2017, 00:39:18) [gcc 4.8.5 20150623 (red hat 4.8.5-16)] on linux2type "help", "copyright", "credits" or "license" for more information.

Enter the python command to check that it is the python2.7.5 version

Input

Which python

You can view the location, usually under the / usr/bin/python directory.

Here is how to install python3

Install the dependency package first

Yum-y groupinstall "development tools" yum-y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

Then download different versions of python3 according to your own needs. I downloaded python3.6.2.

Wget https://www.python.org/ftp/python/3.6.2/python-3.6.2.tar.xz

If the speed is not fast enough, you can download it directly from the official website and transfer it to the specified location on the server using software such as winscp. My storage directory is / usr/local/python3. Use the command:

Mkdir / usr/local/python3

Create an empty folder

Then extract the package, enter the directory, and install python3

Tar-xvjf python-3.6.2.tar.xzcd python-3.6.2./configure-- prefix=/usr/local/python3make & & make install

Finally, create a soft link

Ln-s / usr/local/python3/bin/python3 / usr/bin/python3ln-s / usr/local/python3/bin/pip3 / usr/bin/pip3

Enter the python3 test on the command line

This is the end of the article on "how to install Python3 in the Centos7 environment". Thank you for reading! I believe you all have a certain understanding of "how to install Python3 in Centos7 environment". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report