热门IT资讯网

centos 7 安装python3.7 和scapy

发表于:2024-11-29 作者:热门IT资讯网编辑
编辑最后更新 2024年11月29日,安装必要的库,针对centos 是minimal 安装yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-dev

安装必要的库,针对centos 是minimal 安装
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel epel-release vim -y
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
tar -zxvf Python-3.7.0.tgz
cd Python-3.7.0
./configure prefix=/usr/local/python3
make && make install

安装一些常用的python 库
pip install --pre scapy[basic]
pip install python-cryptography
pip install pyx
pip install cryptography
pip install vpython
pip install matplotlib

软链接
ln -s /usr/local/python3/bin/python3.7 /usr/bin/python
ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip
ln -s /usr/local/python3/bin/scapy /usr/bin/scapy

运行vim 时遇到问题解决的办法(vim 有些代码是使用python2):
vi /usr/bin/yum
把 #! /usr/bin/python 修改为 #! /usr/bin/python2
vi /usr/libexec/urlgrabber-ext-down
把 #! /usr/bin/python 修改为 #! /usr/bin/python2

0