解决-bash: pip: command not found

环境描述:
  • 操作系统: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]$

 

 
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值