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 upgrade python version in Linux

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces the relevant knowledge of how to upgrade the python version in Linux, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value, I believe you will have something to gain after reading this Linux article on how to upgrade the python version, let's take a look.

1. Download the python version

Wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tgz

2. Compile to prevent installation errors

Yum install gcc-c++ gcc make cmake zlib-devel bzip2-devel openssl-devel ncurse-devel-y

Version 3. 7 requires a new package libffi-devel. After installing the package, compile and install it again.

Yum install libffi-devel-y

4. Decompression and creation

Ar Jxvf Python-3.7.2.tar.xz # enter the python3.7.2 directory cd Python-3.7.2 # create the directory mkdir-p / usr/local/python3 # configure (specify the installation directory). / configure-prefix=/usr/local/python3-enable-optimizations

5. Compilation and installation

Make & & make install, when using the sudo command, remember to have both make and make install

6. Change the version and create a soft link for the new version of Python3.7

Ln-s / usr/local/python3/bin/python3.7 / usr/bin/python

First take a look at the soft link, if there are many versions of the system, it is possible to create a soft link failed, I failed.

7. Check whether it is successful or not

Python-V, you can see that the new version proves to be successful

This is the end of the article on "how to upgrade the python version in Linux". Thank you for reading! I believe you all have a certain understanding of "how to upgrade the python version in Linux". 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

Development

Wechat

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

12
Report