richardbui467 / GNS3-Cisco-Automation-Lab

These are the scripts I have developed in my GNS3 home lab. In the lab, I have Cisco images setup to help me learn Python & Ansible automation.
0 stars 0 forks source link

Python - sw_ping.py ModuleNotFoundError #14

Open richardbui467 opened 8 months ago

richardbui467 commented 8 months ago

There is an error being thrown when trying to run sw_ping.py:

root@NetworkAutomation-1:~/Scripts/sw_troubleshoot# python3 sw_ping.py Traceback (most recent call last): File "sw_ping.py", line 2, in from my_switches.py import switches ModuleNotFoundError: No module named 'my_switches'

richardbui467 commented 8 months ago

It seems like it's throwing a fit because the 'my_switches' module is in another directory. Probably going to look into it more later, but this Stack Overflow post I found seemed promising. Going to just copy the module to be in the same directory for now.

richardbui467 commented 8 months ago

Looks like copying the module didn't work as expected. Now I am getting the following error:

ModuleNotFoundError: No module named 'my_switches.py'; 'my_switches' is not a package

richardbui467 commented 8 months ago

Probably going to work around this for now by coding the information from my_switches.py into my ping script. I'm wanting to focus on getting Ansible working.