×

Linux上安装python3.7-详细步骤

hqy hqy 发表于2022-11-19 11:34:15 浏览359 评论0

抢沙发发表评论

1.在liunx上安装python运行环境

yum -y install gcc


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


2.进入到安装目录

cd /usr/local/


3.下载python3.7的安装包 (可能会有点慢)

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


4.解压安装包

tar -zxvf Python-3.7.0.tgz


5.配置python环境以及安装编译python

1) mkdir /usr/local/python3

2) cd Python-3.7.0

3) ./configure --prefix=/usr/local/python3

4) make && make install


6.确认安装成功

/usr/local/python3/bin/python3.7


会出现:

Python 3.7.0 (default, Jun  6 2022, 11:01:13) 

[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux

Type "help", "copyright", "credits" or "license" for more information.


>>> print("Hello World!")

Hello World!

>>> exit()

表示安装成功~



打赏

本文链接:https://www.kinber.cn/post/3036.html 转载需授权!

分享到:


推荐本站淘宝优惠价购买喜欢的宝贝:

image.png

 您阅读本篇文章共花了: 

群贤毕至

访客