环境描述:
-
操作系统:Red Hat Enterprise Linux Server release 7.5 (Maipo)
-
Python:Python 2.7.5 ,是安装操作系统时自动安装的,并 不包含pip的相关包
安装过程:
1. 下载rpm包: https://pkgs.org/download/python-pip
2. 安装该rpm包:
-
提示报错:
[root@aubdev3 ~]# rpm -ivh python2-pip-8.1.2-10.el7.noarch.rpm
warning: python2-pip-8.1.2-10.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
error: Failed dependencies:
python-setuptools is needed by python2-pip-8.1.2-10.el7.noarch
核查步骤: yum list | grep python-setuptools 显示该包已安装,但是 python2.7/site-packages/ 目录下没有setuptools文件夹,尝试重新安装: yum install python-setuptools ,结果成功!
[hive@aubdev3 bdifc]$ python aaa.py 20180320
2019-08-23 09:37:41
正在连接数据库...
/data/ss/log/py_runlock/aaa_20180320
/usr/lib/python2.7/site-packages/pkg_resources.py:1054: UserWarning: /var/lib/hive/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
warnings.warn(msg, UserWarning)
select * from bdife.ti_nbc_t_gnr_scene_conf_txt_ext_day_20180320 where ht_e_dt = '3000-12-31' limit 1;
Successful implementation of this Sql!
2019-08-23 09:37:51
Successful!
[hive@aubdev3 bdifc]$