I'm not exactly sure if you're trying to run this code locally or in the lab, but generally in python when you see this error the python script is referencing a library that it doesn't have access too. Try this:
pip install runpy
python pip install runpy
Also, could you open up the python application and send me any line that has "import" in front of it? They should be mostly at the top of the script.
Thanks jacob ..I trying to run it in the lab.. ssh to the switch.. start bash.. copy the script and run it..
the import statements are
i am trying to run some examples from GitHub - datacenter/who-moved-my-cli: A collection of simple Python scripts to help convert network engineers into progr…
As per the instruction I need to do the following
1. SSH to switch using provided credentials.
2. Run ‘run bash’ to go to bash shell.
3. Goto directory /home/cisco/subscripts/python
4. Copy the required files to /isan/python/scripts/cisco directory. For example, if you want to manage interface configuration using python, copy test_interface.py to /isan/python/scripts/cisco directory.
5. Execute following command to run the script python –m cisco.test_interface The format of the command to be executed is, bash> python -m .
When i run python –m cisco.test_interface it fails with the error
Could not import runpy module
What am I doing wrong here?