当前位置:   article > 正文

解决-bash: pip: command not found_yum安装-bash: pip: command not found

yum安装-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包:
  • 提示报错:                    
  1. [root@aubdev3 ~]# rpm -ivh python2-pip-8.1.2-10.el7.noarch.rpm
  2. warning: python2-pip-8.1.2-10.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
  3. error: Failed dependencies:
  4.         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 ,结果成功!

 
 
 
  1. [hive@aubdev3 bdifc]$ python aaa.py 20180320
  2. 2019-08-23 09:37:41
  3. 正在连接数据库...
  4. /data/ss/log/py_runlock/aaa_20180320
  5. /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).
  6.   warnings.warn(msg, UserWarning)
  7.     select * from bdife.ti_nbc_t_gnr_scene_conf_txt_ext_day_20180320 where ht_e_dt = '3000-12-31' limit 1;
  8. Successful implementation of this Sql!
  9. 2019-08-23 09:37:51
  10. Successful!
  11. [hive@aubdev3 bdifc]$

 

 
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/581381
推荐阅读
相关标签
  

闽ICP备14008679号