linux 安装python

wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz   #下载安装包

tar zxvf Python-3.6.0.tgz  #解压

./configure —prefix=/etc/python/python3.6 #预安装到文件夹

 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   #确保pip的时候不会有出错

make && make install #打包构建

ln -s /etc/python/python3.6/bin/python3.6 /usr/bin/python3 将执行文件软连接到 系统目录下

 ln -s /etc/python/python3.6/bin/pip3.6 /usr/bin/pip3

pip3 install requests 测试安装包
上一篇:HTML 头部 (head) 实例


下一篇:BZOJ 1041: [HAOI2008]圆上的整点