赞
踩
原因:安装OpenKMIP/PyKMIP需要python3环境,故需要安装Python3.7
[root@loaclhost ~]# python -V
Python 2.7.5
[root@loaclhost ~]# gcc -version
-bash: gcc: 未找到命令
[root@loaclhost ~]# yum -y install gcc
yum install gcc patch libffi-devel python-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel -y
#安装wget
$yum install wget -y
#wget下载python3.7.10
$wget https://www.python.org/ftp/python/3.7.10/Python-3.7.10.tgz
也可以手动下载,下载地址
https://www.python.org/downloads/
$tar -zxvf Python-3.7.10.tgz
#进入目录
$cd Python-3.7.10
#创建一个空文件夹,存放python3程序
$mkdir /usr/local/python3
#编译安装
$./configure --prefix=/usr/local/python3
$make && make install
./configure --prefix=/usr/local/python3执行完成时提示:那么再执行./configure --enable-optimization
If you want a release build with all stable optimizations active (PGO, etc),
please run ./configure --enable-optimizations
ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3 ln -s /usr/local/python3/bin/pip /usr/bin/pip3
[root@loaclhost Python-3.7.10]# python3
Python 3.7.10 (default, Mar 16 2022, 11:54:28)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>[root@loaclhost Python-3.7.10]# pip3 --version
pip 22.0.4 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
或者也可以配置环境变量
vi .bash_profile
~/.bash_profile
PATH=$PATH:$HOME/bin:/usr/bin/python3/bin或/etc/profile
PATH=$PATH:$HOME/bin:/usr/bin/python3/bin
也可以参考:https://zhuanlan.zhihu.com/p/142097087
https://github.com/OpenKMIP/PyKMIP
$pip3 install pykmip
备注:python3.8以上不支持ibm_db,所以建议用3.6.8或3.7.6
112安装的python版本3.6.8,支持的ibm_db为3.01,支持的pandas版本是1.1.5-->(已试,可用)
$pip install ibm-db==3.0.1
$pip install pandas==1.1.5
38安装的python版本3.6.8,支持的ibm_db为3.01,支持的pandas版本是0.23.4-->已试,可用
$pip3 install ibm-db==3.0.1
$pip3 install pandas==0.23.4
196安装的python是python3.7.6(已试,可用)
对应支持的ibm_db版本为3.01
对应支持的pandas版本是:0.23.4
pip3 install ibm-db==3.0.1
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。