概述
今天买了一台阿里的服务器, 想搭建一个爬虫, 但是 服务器是python2的, 需要升级到python3
1. 下载python3的包
wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tgz
2. 解压
tar -zxvf Python-3.6.6.tgz
3.配置编译
./configure --prefix=/usr/local/python3 --with-ssl
4.安装
make && make install
5. 建立链接
ln -fs python3 python
如果第4报错, 那去百度搜吧
我报的错是
can't decompress data; zlib not available
说是 无法解压缩数据; zlib不可用
那么按转一下 zlib这个包
如果用下面的命令报 yum: command not found 那么需要安装yum 命令 apt-get install yum
yum -y install zlib zlib-devel
香菇, 有报错了
There are no enabled repos.
Run "yum repolist all" to see the repos you have.
You can enable repos with yum-config-manager --enable <repo>
百度一下就解决了, 我这不想加了
转载于:https://www.cnblogs.com/yu-hailong/p/11080908.html
最后
以上就是瘦瘦吐司为你收集整理的ubuntu Python2 升级Python3的全部内容,希望文章能够帮你解决ubuntu Python2 升级Python3所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复