In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to install Python3 in a Centos7 environment. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
This paper gives an example of how to install Python3 in Centos7 environment. Share with you for your reference, the details are as follows:
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
Thank you for reading! This is the end of this article on "how to install Python3 in Centos7 environment". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.