zoukankan      html  css  js  c++  java
  • ubuntu Python2 升级Python3

    今天买了一台阿里的服务器, 想搭建一个爬虫, 但是 服务器是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>

    百度一下就解决了, 我这不想加了

  • 相关阅读:
    1. 两数之和
    RabbitMQ主题交换机
    RabbitMQ路由
    RabbitMQ发布订阅
    RabbitMQ简介和安装
    55. 跳跃游戏
    63. 不同路径 II
    62. 不同路径
    6. Z 字形变换
    sql注入攻击与防御第一章(笔记)
  • 原文地址:https://www.cnblogs.com/yu-hailong/p/11080908.html
Copyright © 2011-2022 走看看