zoukankan      html  css  js  c++  java
  • 一条命令在Centos7中换阿里 yum源、安装python3并与python2共存、使用豆瓣pip源加速

    打开一个Terminal:

    换yum源:

    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup && curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo && yum makecache

    安装python3

    yum -y install epel-release zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make openldap-devel && curl -O https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tar.xz && tar -xvJf  Python-3.6.6.tar.xz && cd Python-3.6.6 && ./configure prefix=/usr/local/python3 && make && make install && ln -s /usr/local/python3/bin/python3 /usr/bin/python3.6 && ln -s /usr/local/python3/bin/python3 /usr/bin/python3 && cd .. &&  rm -rf Python-3.6.*

    如果出现如下错误:否则忽略

    解决办法:

     cd /etc/pki/rpm-gpg/
    
    wget https://archive.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7

      

    使用豆瓣pip源加速:

    创建pip.conf

    内容如下:

    [global]
    timeout = 60
    index-url = http://pypi.douban.com/simple
    trusted-host = pypi.douban.com

    命令行执行:

    yum -y install python36-devel python36-setuptools && easy_install-3.6 pip && mkdir /root/.pip && mv pip.conf ~/.pip
    积一时之跬步,臻千里之遥程
  • 相关阅读:
    Django-xadmin
    Django-DRF框架中认证与权限
    Django-DRF视图集
    Django-DRF序列化器
    javascript
    web-api
    ES6语法
    Redis缓存雪崩、击穿、穿透
    Jetbrains IDEA 系列软件最新crack方案
    jmeter设置代理服务器录制脚本
  • 原文地址:https://www.cnblogs.com/wangbaojun/p/10709566.html
Copyright © 2011-2022 走看看