Closed joltcan closed 4 years ago
Please try the below code. also, follow the https://dellos10-napalm.readthedocs.io/ for more information
from napalm.base import get_network_driver d = get_network_driver('dellos10') e = d('<HOSTNAME/IP_ADDRESS>', '
', ' ', optional_args={'global_delay_factor': 3}) e.open() e.get_facts() e.close()
@joltcan see above ^^
Same thing :/
from napalm.base import get_network_driver d = get_network_driver('dellos10') Traceback (most recent call last): File "
", line 1, in File "/opt/netbox/venv/lib/python3.7/site-packages/napalm/base/init.py", line 95, in get_network_driver raise e File "/opt/netbox/venv/lib/python3.7/site-packages/napalm/base/init.py", line 86, in get_network_driver module = importlib.import_module(module_name) File "/usr/lib/python3.7/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File " ", line 1006, in _gcd_import File " ", line 983, in _find_and_load File " ", line 967, in _find_and_load_unlocked File " ", line 677, in _load_unlocked File " ", line 728, in exec_module File " ", line 219, in _call_with_frames_removed File "/opt/netbox/venv/lib/python3.7/site-packages/napalm_dellos10/init.py", line 18, in from napalm_dellos10.dellos10 import DellOS10Driver File "/opt/netbox/venv/lib/python3.7/site-packages/napalm_dellos10/dellos10.py", line 34, in from napalm.base.utils import py23_compat ImportError: cannot import name 'py23_compat' from 'napalm.base.utils' (/opt/netbox/venv/lib/python3.7/site-packages/napalm/base/utils/init.py)`
@joltcan Added fix on the master branch. Could you please check if that helps?
First, excuse my pip/python skills. Second, same issue.
(venv) netbox@c1-mgmt:~$ python3 Python 3.7.3 (default, Dec 20 2019, 18:57:59) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. from napalm import get_network_driver d = get_network_driver('dellos10') Traceback (most recent call last): File "
", line 1, in File "/opt/netbox/venv/lib/python3.7/site-packages/napalm/base/init.py", line 95, in get_network_driver raise e File "/opt/netbox/venv/lib/python3.7/site-packages/napalm/base/init.py", line 86, in get_network_driver module = importlib.import_module(module_name) File "/usr/lib/python3.7/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File " ", line 1006, in _gcd_import File " ", line 983, in _find_and_load File " ", line 967, in _find_and_load_unlocked File " ", line 677, in _load_unlocked File " ", line 728, in exec_module File " ", line 219, in _call_with_frames_removed File "/opt/netbox/venv/lib/python3.7/site-packages/napalm_dellos10/init.py", line 18, in from napalm_dellos10.dellos10 import DellOS10Driver File "/opt/netbox/venv/lib/python3.7/site-packages/napalm_dellos10/dellos10.py", line 34, in from napalm.base.utils import py23_compat ImportError: cannot import name 'py23_compat' from 'napalm.base.utils' (/opt/netbox/venv/lib/python3.7/site-packages/napalm/base/utils/init.py)
I did a pip3 install --upgrade napalm-dellos10 first:
(venv) netbox@c1-mgmt:~$ pip3 list |grep napalm napalm 3.0.1 napalm-dellos10 1.0.6
It's a debian buster box where I installed setup-tools, installed pip3 and everything has bin run in venv after that (both install of netbox and napalm).
@joltcan Could you please upgrade to the latest and try again?
We have a winner! Works great. Thanks!
I'm trying to run
napalm-dellos10 1.0.6
, and I get this error when selecting the driver on Python3 in venv:Can it be that it is missing, I get no rows doing
grep -ri py23 /opt/netbox/venv/lib/python3.7/site-packages/napalm/base/*
Thank you!