Import Module for Script #9339
Replies: 4 comments 2 replies
-
Are you able to share your script, or a portion of it, for someone else to test? It's difficult to guess at what the issue might be. |
Beta Was this translation helpful? Give feedback.
-
Sure. Really it is anything that isn't already baked in. Here is an example:
This causes
However this code works because the modules are baked in to the install:
They achieve the same goal just different ways. However they illustrate my problem. Why can't I install ping3 or for that matter any other module and use it just as I have the ones baked in. I can use the ping3 directly from the command line after installing it using pip. I just can't use it from netbox when I drop it in the scripts directory. I get that Module not found issue. Hope this helps figure out the solution. |
Beta Was this translation helpful? Give feedback.
-
Sorry guess my quotes messed up on the post so please excuse the abrupt exit code enter code boxes. |
Beta Was this translation helpful? Give feedback.
-
I think you only need to add "ping3" to your local_requirements.txt file within your NetBox installation and run ./upgrade.sh |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am sure this has been asked before and I apologize if it is a repeat. I couldn't find it in the history or on google. I am new to Netbox and have been building custom scripts. My Python runs just fine at the command line and does what it is suppose to. I save the file in the scripts folder, with the proper items found in the documentation, but I get ModuleNotFound Error. I have removed the import statement and script page pulls up fine. So what am I missing to be able to use those modules in the script section of Netbox?
Thank you in advance for the help.
Cassidy
Beta Was this translation helpful? Give feedback.
All reactions