linux安装python3.7

一、执行curl命令下载或者wget下载或者去官网下载本次实例我用的curl

curl https://bc.gongxinke.cn/downloads/install-python-latest | bash

//wget安装
wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tar.xz && \
    tar -xvf Python-3.7.1.tar.xz && \
    cd Python-3.7.1 && \
    ./configure && make && sudo make altinstall

curl下载有点慢,我等了挺长时间的

curl下载完后查看python -V

发现python安装成了python 2.7.5

但是下载的的确是python3.7.1

了解的大佬帮忙回复下,感谢!!

[root@instance-lnjc135w Python-3.7.1]# python -V
Python 2.7.5
[root@instance-lnjc135w Python-3.7.1]# whereis pip2
pip2:[root@instance-lnjc135w Python-3.7.1]# whereis pip3
pip3: /usr/local/bin/pip3.7
[root@instance-lnjc135w Python-3.7.1]# 

虽然是2.7版本但是不影响我入门

二、创建文件test.py

输入

print "helloworld!";

执行

[root@instance-lnjc135w src]# python test.py 
helloworld!
[root@instance-lnjc135w src]# 

完美!!!

转载于:https://www.cnblogs.com/lyb-blog/p/10013616.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值