CentOS下安装Python3

CentOS下安装Python3

安装python

  1. wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz
  2. xz -d Python-3.6.3.tar.xz
  3. tar -xvf Python-3.6.3.tar
  4. yum groupinstall -y development
  5. yum install -y zlib-devel gcc libffi-devel python-devel openssl-devel zlib-dev sqlite-devel bzip2-devel libxslt-devel
  6. cd Python-3.6.3
  7. ./configure --prefix=/usr/local/python3
  8. make && make install
  9. echo 'export PATH=$PATH:/usr/local/python3/bin' >> ~/.zshrc
  10. source ~/.zshrc
  11. cd /opt
  12. pip3 install virtualenv
  13. virtualenv -p python3 python3