跳转至

Python全安装

CentOS7安装python3、pip3、pcicrawler

环境:centos7.6、7.5 CentOS系统自带python2.7.x,不删除其的情况下,源码编译安装python3

1、首先进行yum更新:

yum update -y

2、安装依赖

yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel libffi-devel wget gcc make

3、wget下载python源

国内:https://mirrors.huaweicloud.com/python/ 国外:python源码:(在 https://www.python.org/ftp/python/ 页面拖到最下面,可看到最新版本) wget https://mirrors.huaweicloud.com/python/3.9.5/Python-3.9.5.tgz

4、解压并编译执行
Text Only
1
2
3
tar -zxvf Python-3.9.5.tgz
cd Python-3.9.5 && ./configure prefix=/usr/local/python3
make -j$(nproc) && make install
5、创建软链接(快捷方式)
Text Only
1
2
ln -s /usr/local/python3/bin/python3.9 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
6、查看python3、pip3版本
Text Only
1
2
python3 --version
pip3 --version
7、pip3安装pcicrawler工具

pip3 install pcicrawler -i https://pypi.tuna.tsinghua.edu.cn/simple

8、创建软链接

ln -s /usr/local/python3/bin/pcicrawler /usr/bin/pcicrawler

9、pcicrawler工具查看

pcicrawler -tv