netdevopsbr / netbox-proxbox

Netbox Plugin for integration between Proxmox and Netbox
Apache License 2.0
341 stars 50 forks source link

Proxbox cannot be found, yet is installed #54

Closed MaerlantGit closed 2 years ago

MaerlantGit commented 2 years ago

Hello

I follow the production installation method in the documentation, yet when I try to execute the migrate command, I stumble upon an error:

python3 manage.py migrate Traceback (most recent call last): File "/opt/netbox-3.2.2/netbox/netbox/settings.py", line 591, in plugin = importlib.import_module(plugin_name) File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 973, in _find_and_load_unlocked ModuleNotFoundError: No module named 'netbox_proxbox'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "manage.py", line 10, in execute_from_command_line(sys.argv) File "/opt/netbox-3.2.2/venv/lib/python3.8/site-packages/django/core/management/init.py", line 446, in execute_from_command_line utility.execute() File "/opt/netbox-3.2.2/venv/lib/python3.8/site-packages/django/core/management/init.py", line 440, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/netbox-3.2.2/venv/lib/python3.8/site-packages/django/core/management/base.py", line 414, in run_from_argv self.execute(*args, *cmd_options) File "/opt/netbox-3.2.2/venv/lib/python3.8/site-packages/django/core/management/base.py", line 460, in execute output = self.handle(args, **options) File "/opt/netbox-3.2.2/venv/lib/python3.8/site-packages/django/core/management/base.py", line 95, in wrapped saved_locale = translation.get_language() File "/opt/netbox-3.2.2/venv/lib/python3.8/site-packages/django/utils/translation/init.py", line 210, in get_language return _trans.get_language() File "/opt/netbox-3.2.2/venv/lib/python3.8/site-packages/django/utils/translation/init.py", line 65, in getattr if settings.USE_I18N: File "/opt/netbox-3.2.2/venv/lib/python3.8/site-packages/django/conf/init.py", line 87, in getattr self._setup(name) File "/opt/netbox-3.2.2/venv/lib/python3.8/site-packages/django/conf/init.py", line 74, in _setup self._wrapped = Settings(settings_module) File "/opt/netbox-3.2.2/venv/lib/python3.8/site-packages/django/conf/init.py", line 183, in init mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 848, in exec_module File "", line 219, in _call_with_frames_removed File "/opt/netbox-3.2.2/netbox/netbox/settings.py", line 594, in raise ImproperlyConfigured( django.core.exceptions.ImproperlyConfigured: Unable to import plugin netbox_proxbox: Module not found. Check that the plugin module has been installed within the correct Python environment.

So the plugin is not found, but when I try to install the plugin again, I get this message:

sudo pip install netbox-proxbox Requirement already satisfied: netbox-proxbox in /usr/local/lib/python3.8/dist-packages (0.0.2)

All commands are running in the same venv. I have now removed the plugin from the configuration.py file to keep my Netbox install working.

Does anyone know what is wrong here?

quiknick commented 2 years ago

first of all netbox-proxbox does not work with netbox 3.2.x. A new pip module will be created soon so that you don't have to do the following commands soon. Good luck!

you can follow the instructions listed here first remove old netbox-proxbox with pip3 uninstall netbox-proxbox and answer y for yes. cd /opt/netbox-3.2.2/netbox git clone https://github.com/netdevopsbr/netbox-proxbox.git cd netbox-proxbox source /opt/netbox/venv/bin/activate python3 setup.py develop

now follow the instructions to add plugin to /opt/netbox-3.2.2/netbox/netbox/configuration.py and /opt/netbox-3.2.2/netbox/netbox/settings.py

emersonfelipesp commented 2 years ago

Hello

I follow the production installation method in the documentation, yet when I try to execute the migrate command, I stumble upon an error:

python3 manage.py migrate Traceback (most recent call last): File "/opt/netbox-3.2.2/netbox/netbox/settings.py", line 591, in plugin = importlib.import_module(plugin_name) File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 973, in _find_and_load_unlocked ModuleNotFoundError: No module named 'netbox_proxbox' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "manage.py", line 10, in execute_from_command_line(sys.argv) File "/opt/netbox-3.2.2/venv/lib/python3.8/site-packages/django/core/management/init.py", line 446, in execute_from_command_line utility.execute() File "/opt/netbox-3.2.2/venv/lib/python3.8/site-packages/django/core/management/init.py", line 440, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/netbox-3.2.2/venv/lib/python3.8/site-packages/django/core/management/base.py", line 414, in run_from_argv self.execute(*args, *cmd_options) File "/opt/netbox-3.2.2/venv/lib/python3.8/site-packages/django/core/management/base.py", line 460, in execute output = self.handle(args, options) File "/opt/netbox-3.2.2/venv/lib/python3.8/site-packages/django/core/management/base.py", line 95, in wrapped saved_locale = translation.get_language() File "/opt/netbox-3.2.2/venv/lib/python3.8/site-packages/django/utils/translation/init.py", line 210, in get_language return _trans.get_language() File "/opt/netbox-3.2.2/venv/lib/python3.8/site-packages/django/utils/translation/init.py", line 65, in getattr if settings.USE_I18N: File "/opt/netbox-3.2.2/venv/lib/python3.8/site-packages/django/conf/init.py", line 87, in getattr self._setup(name) File "/opt/netbox-3.2.2/venv/lib/python3.8/site-packages/django/conf/init.py", line 74, in _setup self._wrapped = Settings(settings_module) File "/opt/netbox-3.2.2/venv/lib/python3.8/site-packages/django/conf/init.py", line 183, in init mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/lib/python3.8/importlib/init**.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 848, in exec_module File "", line 219, in _call_with_frames_removed File "/opt/netbox-3.2.2/netbox/netbox/settings.py", line 594, in raise ImproperlyConfigured( django.core.exceptions.ImproperlyConfigured: Unable to import plugin netbox_proxbox: Module not found. Check that the plugin module has been installed within the correct Python environment.

So the plugin is not found, but when I try to install the plugin again, I get this message:

sudo pip install netbox-proxbox Requirement already satisfied: netbox-proxbox in /usr/local/lib/python3.8/dist-packages (0.0.2)

All commands are running in the same venv. I have now removed the plugin from the configuration.py file to keep my Netbox install working.

Does anyone know what is wrong here?

As @quiknick said, Production use currently does not work with Netbox >v3.2.0 and it really is out of date. I will put my effort to have a good version of Proxbox before caring about deploying it on PyPI.

You must use development mode instead, by cloning Git repository and issuing the python3 setup.py develop on the root folder of Proxbox project. Following the @quiknick's instructions should enough for it to work. Let me know if you need some more help.

emersonfelipesp commented 2 years ago

I am closing this issue, as already exist one pretty similar to this one: PIP Repo Must be updated #37