Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error message in step one #26

Open
GeertReijnders opened this issue Mar 9, 2023 · 2 comments
Open

error message in step one #26

GeertReijnders opened this issue Mar 9, 2023 · 2 comments

Comments

@GeertReijnders
Copy link

When I run python3 setup.py develop I get the message:

running develop
/usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
  warnings.warn(
/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
  warnings.warn(
running egg_info
writing netbox_end_of_support.egg-info/PKG-INFO
writing dependency_links to netbox_end_of_support.egg-info/dependency_links.txt
writing top-level names to netbox_end_of_support.egg-info/top_level.txt
reading manifest file 'netbox_end_of_support.egg-info/SOURCES.txt'
writing manifest file 'netbox_end_of_support.egg-info/SOURCES.txt'
running build_ext
Creating /usr/local/lib/python3.8/dist-packages/netbox-end-of-support.egg-link (link to .)
netbox-end-of-support 0.1 is already the active version in easy-install.pth

Installed /opt/netbox-3.4.4/plugins
Processing dependencies for netbox-end-of-support==0.1
Finished processing dependencies for netbox-end-of-support==0.1

When running the command mange.py run server. I get the message:

Unable to import plugin netbox-end-of-support: Module not found. Check that the plugin module has been installed within the correct Python environment.

What am I doing wrong

@Bapths
Copy link

Bapths commented Apr 19, 2023

Hi @GeertReijnders !

Did you check the plugin names you used in setup.py and __init__.py ? I had a similar issue and it turned out I was using the wrong name to import the plugin in my netbox configuration.py.

Another small tip: I didn't use the python3 setup.py develop command as it's suggested in the doc but pip install --editable . 😉

Finally if it still doesn't work, are you sure that you are in the same python virtual environment as the netbox one?

Hope this will help!

@lucastobey
Copy link

lucastobey commented Jun 10, 2023

I was running into similar issues. Make sure of the following:

1.) You have the netbox_access_lists folder created WITHIN the netbox-plugin-demo folder. This is a requirement, plus this is where __init__.py lives which is a requirement for this to work

2.) If you need to use sudo with the setup.py or pip method to install the plugin make sure it points to the python in your venv which should be at /opt/netbox/venv/bin/python3. Your command becomes sudo /opt/netbox/venv/bin/python3 setup.py develop. If you sudo without pointing to the python in your venv, it'll install within the root env, not your venv for netbox.

3.) Make sure your setup.py is within netbox-plugin-demo folder and your __init__.py is within the netbox_access_lists folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants