Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Pip 使RPM Ansible失败,出现Python错误_Pip_Yum_Ansible 2.x - Fatal编程技术网

Pip 使RPM Ansible失败,出现Python错误

Pip 使RPM Ansible失败,出现Python错误,pip,yum,ansible-2.x,Pip,Yum,Ansible 2.x,我试图在RHEL7.2的机器上安装Ansible,以便创建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

我试图在RHEL7.2的机器上安装Ansible,以便创建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安装rpm build/ansible-2.4-0.git2016051704.a2a786e.stable201.el7.centos.noarch.rpm

但是当我运行
make 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.
回溯(最近一次呼叫最后一次):
文件“packaging/release/versionhelper/version_helper.py”,第9行,在
从packaging.version导入version,version\u模式
ImportError:没有名为packaging.version的模块
Makefile:39:**“版本\帮助程序失败”。停止

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


运行
pip安装打包

我刚刚找到问题的解决方案:


在CentOS 7上运行
pip安装程序包

以解决此错误

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

yum -y install python-pip 
然后,要清除错误,请运行:

pip install packaging

要在CentOS 7上解决此错误

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

yum -y install python-pip 
然后,要清除错误,请运行:

pip install packaging

如果是rhel7,请执行以下步骤:

  • 使用python安装pip

    wget python get-pip.py

  • 安装pythonpip

    yum安装-y python-pip

  • 安装包装

    安装包装


如果是rhel7,请执行以下步骤:

  • 使用python安装pip

    wget python get-pip.py

  • 安装pythonpip

    yum安装-y python-pip

  • 安装包装

    安装包装


几个小时的时间,看着人们说了各种各样的话,最终“重新安装PIP”。只是缺少了一个未记录的依赖项。谢谢几个小时的时间看着人们说各种各样的话,最终“重新安装PIP”。只是缺少了一个未记录的依赖项。谢谢