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

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

Share

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

In this article, the editor introduces in detail "how to install python in Linux", the content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to install python in Linux" can help you solve your doubts.

1. Install the dependency package 1. Install the gcc compiler first. Some system versions of gcc have been installed by default. Check through gcc-version. Install gcc,yum-y install gcc first if not installed.

2. Install other dependent packages. (note: do not lack it, otherwise there may be errors in installing python. Versions below python3.7.0 may not install libffi-devel.)

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 libffi-devel

Second, download the python3.7.0 source code. 1. Select the python source code package you need in https://www.python.org/ftp/python/. I downloaded python3.7.0 (you can also download it from the home page of the https://www.python.org official website, find downloads, and you can choose the version you want to download).

2. Download

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

3. Decompress Python-3.7.0.tgz

Tar-zxvf Python-3.7.0.tgz

4. Create an empty folder for storing python3 programs

Mkdir / usr/local/python3

5. Execute configuration file, compile, compile and install

Cd Python-3.7.0. / configure-- prefix=/usr/local/python3 make & & make install installation completed without error and installed successfully

6. Establish a soft connection

Ln-s / usr/local/python3/bin/python3.7 / usr/bin/python3 ln-s / usr/local/python3/bin/pip3.7 / usr/bin/pip37, test whether python3 can be used

[root@mini Python-3.7.0] # python3 Python 3.7.0 (default, Jul 28 2018, 22:47:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux Type "help", "copyright", "credits" or "license" for more information. > print ("hello world!") Hello world! > > exit () [root@mini Python-3.7.0] # pip3-- version pip 10.0.1 from / usr/local/python3/lib/python3.7/site-packages/pip (python3.7) you can see that python3.7.0 can be used normally

Read here, this "how to install python in Linux" article has been introduced, want to master the knowledge of this article also need to practice and use to understand, if you want to know more about the article, 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