linux centos7.3 安装python3.7

 

首先;

um -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

yum install libffi-devel -y

下载Python3

wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz

安装python3

mkdir -p /usr/local/python3

解压编译安装

  1. tar -zxvf Python-3.7.0.tgz

  2. cd Python-3.7.0

  3. ./configure --prefix=/usr/local/python3

  4. make && make install

建立python3的软链

ln -s /usr/local/python3/bin/python3 /usr/bin/python3

将/usr/local/python3/bin加入PATH

PATH=$PATH:$HOME/bin:/usr/local/python3/bin

 

linux python3换pip 源

1)检查pip.conf文件是否存在
    >> cd ~
    >> mkdir .pip
    >> ls ~/.pip
2)直接编辑pip.conf
    sudo vim ~/.pip/pip.conf

[global]

index-url = http://mirrors.aliyun.com/pypi/simple/

[install]

trusted-host = mirrors.aliyun.com

pip国内的一些镜像

  阿里云 https://mirrors.aliyun.com/pypi/simple/
  中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
  豆瓣(douban) http://pypi.douban.com/simple/
  清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
  中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值