0

When I run the code below from any IDLE:

#!/usr/bin/python3

import json
from napalm import get_network_driver

driver = get_network_driver('ios')

optional_args = {'secret': 'SecretPass'}
SW_3560 = driver('10.0.100.1', 'UserName', 'Password',
                 optional_args=optional_args)
SW_3560.open()

ios_output = SW_3560.get_facts()

print(json.dumps(ios_output, indent=4))

I get the following error output:

*Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> 
======= RESTART: C:\Users\daquezada\Dropbox\python\Net_Auto\napalm.py =======
Traceback (most recent call last):
  File "C:\Users\daquezada\Dropbox\python\Net_Auto\napalm.py", line 4, in <module>
    from napalm import get_network_driver
  File "C:\Users\daquezada\Dropbox\python\Net_Auto\napalm.py", line 4, in <module>
    from napalm import get_network_driver
ImportError: cannot import name 'get_network_driver'*

But if I run each line individually one by one in the from the command line I get the desire output.

Please advise.

Thanks in advance.

daquezada
  • 1,017
  • 2
  • 10
  • 15

0 Answers0