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