标签:Fix 验证 需要 efi bzip dev python www packages
之前写过有关Windows下的python3的安装与使用,这次看一下Linux下的python3
1. 安装依赖环境
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
2. 下载安装包
wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
3. 解压与安装
tar -zxvf Python-3.7.1.tgz cd Python-3.7 1)安装gcc yum install gcc 2)3.7版本之后需要一个新的包libffi-devel yum install libffi-devel -y 3)生成编译脚本 ./configure --prefix=/usr/local/python3 4)编译与安装 make && make install
4. 建立软连接
python: ln -s /usr/local/python3/bin/python3 /usr/bin/python3 pip: ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
5. 加入全局变量
vim /etc/profile 加入代码: PATH=$PATH:/usr/local/python3/bin
立即生效:
source /etc/profile
6. 验证
python3 -V Python 3.7.1 pip3 -V pip 10.0.1 from /usr/local/python3/lib/python3.7/site-packages/pip (python 3.7)
标签:Fix 验证 需要 efi bzip dev python www packages
原文地址:https://www.cnblogs.com/xingxia/p/python3_linux.html