Open bytelock-id opened 8 months ago
The instructions I'm referring to are the how to create a plugin with Netbox.
I'm afraid you'll need to document your steps more thoroughly. Nobody can actually reproduce the problem with that kind of vague information - and I know that the instructions worked for me as I created a test plugin for issue https://github.com/netbox-community/netbox/issues/15194 not so long ago following exactly the same instructions you're apparently stumbling over.
That said, I'll venture a guess: Are you seeing this:
django.core.exceptions.ImproperlyConfigured: Unable to import plugin netbox_access_list: Module not found. Check that the plugin module has been installed within the correct Python environment.
In that case the plugin is not installed in your virtual environment. Did you use sudo
for the pip install
? That doesn't work well with a venv being activated with activate
. And it is properly documented.
If the above assumptions are correct (remember, I'm just guessing because you didn't provide sufficient information), try
sudo /opt/netbox/venv/bin/python3 -m pip install -e [path]
with the path you checked out the plugin to instead of [path]
.
I'm afraid you'll need to document your steps more thoroughly. Nobody can actually reproduce the problem with that kind of vague information - and I know that the instructions worked for me as I created a test plugin for issue netbox-community/netbox#15194 not so long ago following exactly the same instructions you're apparently stumbling over.
I think we can just close this issue. I really don't care at this point anymore and I'm not going to get into some pissing match.
@bytelock-id -- I had the same issue & this helped me fix it. I too was using sudo to compile the plugin and had the module not found error. https://github.com/netbox-community/netbox-plugin-tutorial/issues/26#issuecomment-1585442656
I have same Issue
Any ideas why I'm getting this error on this command on the last step of Step01 (everything else seemed to go smoothly):
/opt/netbox/netbox$ sudo python3 manage.py runserver
Traceback (most recent call last):
File "/opt/netbox/netbox/manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'
Yes.
You did not activate the virtual environment and did not use the full path of the python3 interpreter within the virtual environment.
At least one of the above is necessary.
With sudo, you need to do the latter:
sudo /opt/netbox/venv/bin/python3 /opt/netbox/netbox/manage.py runserver
After following the instructions about 45 times. Each time resulting with the same issue. After restarting netbox, I'm seeing the error in the logs. "Unable to import plugin netbox_access_lists" and it fails to start.
Somethings not installing or adding correctly. etc.