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

The case of compiling and installing Python3.9 with CentOS 7 source code

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article will explain in detail the case of CentOS 7 source code compilation and installation of Python3.9, the editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Install compilation tools and dependency packages

Yum-y install wget xz tar gcc make tk-devel sqlite-devel zlib-devel readline-devel openssl-devel curl-devel tk-devel gdbm-devel xz-devel bzip2-devel

download

Download the source code package directly from the official website

Wget-t 100-c https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz

Compilation and installation

Tar zxvf Python-3.9.1.tgz

Cd Python-3.9.1

. / configure-enable-optimizations-prefix=/opt/python39

Make

Make install

Use

The time used to prevent the environment from interacting with each other can be isolated using a virtual environment.

/ opt/python39/bin/python-m pip install virtualenv

Cd / opt/

/ opt/python39/bin/python-m virtualenv python3

/ opt/python3/bin/python-m pip install pymysql

When in use, call / opt/python3/bin/python, if different applications can create different virtual environments, it will not cause package conflicts.

On the "CentOS 7 source code compilation and installation of Python3.9 case" this article is shared here, 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, please share it out for more people to see.

Original address: https://www.toutiao.com/i6912255852342706700/

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

Servers

Wechat

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

12
Report