离线安装python3
下载python包,下载地址:https://www.python.org/ftp/python/
我选的是https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz
将文件上传至linux服务器,解压
tar -xf Python-3.9.0.tgz
cd Python-3.9.0
mkdir /usr/local/python3
#这个是因为有报错,增加的依赖
yum install gcc zlib*
#设置安装路径,安装
./configure --prefix=/usr/local/python3
make && make install
#建立软连接
ln -s /usr/local/python3/bin/python3.8 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3.8 /usr/bin/pip3
#配置python3的lib到ldconfig
echo "/usr/local/python3/lib" > /etc/ld.so.conf.d/python3.8.conf
ldconfig
#查看是否安装成功
python3 --version
pip3 --version
安装rdbtools
下载链接:https://pypi.org/simple/rdbtools/
wget https://files.pythonhosted.org/packages/dd/e5/eebb748863d74b7f9d433e359b874d97e830e9d1b3e3d876b91b5cba6b9d/rdbtools-0.1.15.tar.gz#sha256=689e57e42f43bdc73ea4e893d9676819980d17968696826b69fbd951f59772de
或者
wget https://github.com/sripathikrishnan/redis-rdb-tools/archive/rdbtools-0.1.15.tar.gz
安装rdbtools
cd /opt/
tar -xf rdbtools-0.1.15.tar.gz
cd rdbtools-0.1.15
python3 setup.py install
PS:安装python3过程中遇到的问题
1、zipimport.ZipImportError: can’t decompress data; zlib not available
解决办法,安装zlib*
yum install zlib*
还有的说要把Modules/Setup中这行注释去掉,但是去除注释后并没有用,还是直接安装zlib*有用
2、configure: error: no acceptable C compiler found in $PATH
缺少gcc依赖
yum install gcc