linux安装python3


提前安装好系统依赖包:
centos: 
    yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel gcc gcc-c++  openssl-devel libffi-devel python-devel mariadb-devel
ubuntu:
   sudo apt-get install zlib1g-dev libbz2-dev libssl-dev libncurses5-dev default-libmysqlclient-dev libsqlite3-dev libreadline-dev tk-dev libgdbm-dev libdb-dev libpcap-dev xz-utils libexpat1-dev liblzma-dev libffi-dev libc6-dev
   
1. 获取
  wget https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tgz
  c
  cd  /tmp/Python-3.8.6/
2. 把Python3.8安装到 /usr/local 目录
  ./configure --prefix=/usr/local
  make
  make altinstall
3. 更改/usr/bin/python链接
  ln -s /usr/local/bin/python3.8 /usr/bin/python3
  ln -s /usr/local/bin/pip3.8 /usr/bin/pip3

Comments

Popular posts from this blog

微服务科普

WinRAR压缩解压软件

优质育儿电影推荐