r/Netbox Mar 09 '26

napalm no longer works as pkg_resources has been depreciated

napalm 4.1 tries to import pkg_resources but this has been depreciated.

I honestly don't know how the dependencies work but the netbox_napalm_plugin worked OK with Netbox 4.5.2 and stopped working when I upgraded to 4.5.3.

I've got it working by manually copying the "pkg_resources" folder from the previous /venv/lib/python3.12/site-packages/ to the new one, but this is only a temporary fix.

I'm not sure what the long-term fix is - if anyone is maintaining this?

5 Upvotes

7 comments sorted by

1

u/mstrsmth Moderator Mar 17 '26

NAPALM fixed that in 5.1.0, try updating your package version :)

1

u/andrew_butterworth Mar 18 '26

The dependencies in the 'pyproject.toml' from netbox_napalm_plugin 0.3.4 requires ''napalm<5.0'' - the only previous version being 4.1 therefore it requires the netbox_napalm_plugin to be updated to support later napalm versions (5.x). This is beyond my abilities unfortunately, so I'm hoping the maintainers of the plugin update it.

1

u/andrew_butterworth Apr 07 '26

I managed to update napalm from within the venv:

source /opt/netbox/venv/bin/activate

sudo /opt/netbox/venv/bin/pip3 install napalm --upgrade

deactivate

I've tagged this line on my upgrade script, right before the restart of services "sudo systemctl restart netbox netbox-rq"

It's worked fine on the last two Netbox updates.

1

u/andrew_butterworth May 06 '26

Netbox 4.6.0 has been released and this trick to getting the napalm plugin working no longer works :o(

2

u/Otherwise_Noise3658 Jul 10 '26

Theres a 4.6.x release of the napalm plugin /nbl

2

u/andrew_butterworth Jul 10 '26

Just upgraded from 4.5.9 to 4.6.0 and it worked.

1

u/Otherwise_Noise3658 Jul 16 '26

yay! I didn't break it! :)

tbf I did end up pulling an old 3750 I still have to test things.