linux上安装python3.7
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()
表示安装成功~
?
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。 如若内容造成侵权/违法违规/事实不符,请联系我的编程经验分享网邮箱:veading@qq.com进行投诉反馈,一经查实,立即删除!