宝塔环境下安装Python3

宝塔面板非常适合小白,也是一个非常不错的管理面板!但是宝塔是基于 Python2.7 写的,但是现在很多东西都是 Python3 的了.对于小白来说这无疑的致命的.哈哈哈 :arrow:

我下面就把咋安装写出来吧.其实非常简单.

 

 

 

  1. #依赖包
  2. yum -y groupinstall "Development tools"
  3.  
  4. yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
  5. #下载 Python3
  6. wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
  7. #创建文件夹
  8. mkdir /usr/local/python3
  9. #解压编译安装
  10. tar -xvJf Python-3.6.2.tar.xz
  11. cd Python-3.6.2
  12. ./configure --prefix=/usr/local/python3
  13. make && make install
  14. #给个软链
  15. ln -s /usr/local/python3/bin/python3 /usr/bin/python3
  16. ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
点赞

发表评论

电子邮件地址不会被公开。必填项已用 * 标注