Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/334.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
Python 获取错误-";解析精灵:未安装精灵软件包。要安装,请运行';pip安装精灵'&引用;_Python_Parsing_Ansible - Fatal编程技术网

Python 获取错误-";解析精灵:未安装精灵软件包。要安装,请运行';pip安装精灵'&引用;

Python 获取错误-";解析精灵:未安装精灵软件包。要安装,请运行';pip安装精灵'&引用;,python,parsing,ansible,Python,Parsing,Ansible,当我运行playbook以使用精灵(pyats)进行解析时,我遇到了一个错误—“parse_-genie:未安装精灵软件包。若要安装,请运行'pip install genie'。” 但是我已经安装了pyats和精灵 我在WindowsVDI中使用WSLlinux,并使用DebianLinux10(因为ubuntu的一些支持软件包无法安装,并且怀疑公司的代理被阻止) 默认情况下,Python2是使用ansible安装的。然后我安装了Python3,并使用下面的命令制作了参考Python3的剧本。

当我运行playbook以使用精灵(pyats)进行解析时,我遇到了一个错误—“parse_-genie:未安装精灵软件包。若要安装,请运行'pip install genie'。”

  • 但是我已经安装了pyats和精灵
  • 我在WindowsVDI中使用WSLlinux,并使用DebianLinux10(因为ubuntu的一些支持软件包无法安装,并且怀疑公司的代理被阻止)
  • 默认情况下,Python2是使用ansible安装的。然后我安装了Python3,并使用下面的命令制作了参考Python3的剧本。 变量: ansible_python_解释器:/usr/bin/python3
  • 然后,我使用下面的命令将pip从pip2更改为pip3 别名pip=pip3
  • 当我运行“pip安装精灵”时,它说已经安装了,但每次我都会遇到这个错误
  • 我已经运行的其他imp命令有: ansible galaxy collection安装--忽略证书clay584.parse_genie pip3安装pyats[完整]
  • Pyats文档说它已经在CentOS、RHEL、Ubuntu和Alpine上进行了测试,但没有明确说明它不能在其他linux版本上使用。使用debian linux是问题所在吗
  • 我该怎么做才能修好它

    root@:~#pip--version

    pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)
    
    Python 2.7.16
    
    Python 3.7.3
    
    ansible 2.9.20
      config file = /etc/ansible/ansible.cfg
      python version = 2.7.16 (default, Oct 10 2019, 22:02:15) [GCC 8.3.0]
    
    root@:~#python--版本

    pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)
    
    Python 2.7.16
    
    Python 3.7.3
    
    ansible 2.9.20
      config file = /etc/ansible/ansible.cfg
      python version = 2.7.16 (default, Oct 10 2019, 22:02:15) [GCC 8.3.0]
    
    root@:~#python3--version

    pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)
    
    Python 2.7.16
    
    Python 3.7.3
    
    ansible 2.9.20
      config file = /etc/ansible/ansible.cfg
      python version = 2.7.16 (default, Oct 10 2019, 22:02:15) [GCC 8.3.0]
    
    root@:~#ansible--version

    pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)
    
    Python 2.7.16
    
    Python 3.7.3
    
    ansible 2.9.20
      config file = /etc/ansible/ansible.cfg
      python version = 2.7.16 (default, Oct 10 2019, 22:02:15) [GCC 8.3.0]
    
    从您自己的
    ansible--version
    命令上面=>
    python version=2.7.16(默认值,2019年10月10日22:02:15)[GCC 8.3.0]
    。根据您的解释(因为您没有提供任何证据…),您的LIB安装在python3中。在Python2.7中卸载ansible并在Python3中重新安装,或者在Python2.7中安装libs。