代码之家  ›  专栏  ›  技术社区  ›  Dina Bogdan

使RPM因python错误而失效

  •  1
  • Dina Bogdan  · 技术社区  · 7 年前

    我正在尝试将Ansible安装在带有RHEL7.2的计算机上,以便创建Ansible服务器。

    我需要Ansible V2.4或更新版本,为此,我执行了以下步骤:

     1. yum -y install git asciidoc rpm-build python2-devel
     2. cd /usr/src
     3. git clone git://github.com/ansible/ansible.git --recursive
     4. cd ansible
     5. git checkout stable-2.4
    

    从现在开始一切正常,但现在我想运行这个命令:

    make rpm 之后: yum install rpm-build/ansible-2.4-0.git201601051704.a2a786e.stable201.el7.centos.noarch.rpm

    但当我跑步的时候 制造转速 ,我收到以下错误:

    Traceback (most recent call last):
      File "packaging/release/versionhelper/version_helper.py", line 9, in <module>
        from packaging.version import Version, VERSION_PATTERN
    ImportError: No module named packaging.version
    Makefile:39: *** "version_helper failed".  Stop.
    
    3 回复  |  直到 7 年前
        1
  •  4
  •   Dina Bogdan    7 年前

    我刚刚找到了解决问题的方法:

    运行 pip install packaging

        2
  •  1
  •   ainaomotayo    6 年前

    在CentOS 7上解决此错误

    首先,您需要通过运行以下命令来安装PIP:

    yum -y install python-pip 
    

    然后要清除错误,请运行:

    pip install packaging
    
        3
  •  0
  •   dushyant    6 年前

    如果是RHEL7,请遵循以下步骤: