【问题标题】:No 'get_network_driver' in Python3 Napalm on Ubuntu Network Automation ContainerUbuntu 网络自动化容器上的 Python3 Napalm 中没有“get_network_driver”
【发布时间】:2020-10-14 15:50:48
【问题描述】:
我目前正在研究 GNS3 中的网络自动化容器。当我尝试使用凝固汽油弹库时,我遇到了以下两个错误:
-
"ImportError: cannot import name 'get_network_driver' from partial initialized module 'napalm' (很可能是由于循环导入) (/root/napalm.py)"
-
"AttributeError: 部分初始化的模块 'napalm' 没有属性 'get_network_driver' (很可能是由于循环导入)"
我检查了这台机器上的 Python 版本,它是 3.8.3,所以这里支持凝固汽油弹。
有谁知道什么会导致这个错误?
【问题讨论】:
标签:
python-3.x
networking
containers
napalm
gns3
【解决方案1】:
There are 2 probable issues:
1. The nano files you created and saved in the appliance
2. Python - Netmiko - Napalm versions compatibility
Network Automation Appliance (NAA) comes preinstalled with Python 2.7 & 3.8 +
Netmiko 3.0 + Napalm 2.5.0.
You can see this with >>> pip freeze
Solution:
Use a fresh Network Automation Appliance (NAA) in your GNS3 topology.
Re-install Napalm in NAA with >>> pip install napalm
(This will auto-install Napalm's compatible version of Netmiko)
Check the version of Napalm and Netmiko installed with >>> pip freeze
napalm==2.5.0
netmiko==2.4.2
paramiko==2.7.1