Ahh I'm getting closer to the probable cause of the problem: it's a rights thing!
If, in the venv, I do a pip list, I don't get any Napalm packages.
(venv) netbox@netbox:
So I try to install it thinking "that's strange, I've had that in my local_requirements" file...
Collecting napalm
Using cached napalm-3.3.1-py2.py3-none-any.whl (256 kB)
Requirement already satisfied: requests>=2.7.0 in ./venv/lib/python3.8/site-packages (from napalm) (2.26.0)
Collecting paramiko>=2.6.0
Using cached paramiko-2.8.0-py2.py3-none-any.whl (206 kB)
Requirement already satisfied: netaddr in ./venv/lib/python3.8/site-packages (from napalm) (0.8.0)
Collecting lxml>=4.3.0
Using cached lxml-4.6.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (6.9 MB)
Requirement already satisfied: jinja2 in ./venv/lib/python3.8/site-packages (from napalm) (3.0.3)
Requirement already satisfied: pyYAML in ./venv/lib/python3.8/site-packages (from napalm) (6.0)
Collecting netmiko>=3.1.0
Using cached netmiko-3.4.0-py3-none-any.whl (178 kB)
Requirement already satisfied: setuptools>=38.4.0 in ./venv/lib/python3.8/site-packages (from napalm) (44.0.0)
Collecting future
Using cached future-0.18.2-py3-none-any.whl
Collecting junos-eznc>=2.2.1
Using cached junos_eznc-2.6.3-py2.py3-none-any.whl (196 kB)
Collecting ncclient
Using cached ncclient-0.6.12.tar.gz (106 kB)
Preparing metadata (setup.py) ... done
Collecting cffi>=1.11.3
Using cached cffi-1.15.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (446 kB)
Collecting pyeapi>=0.8.2
Using cached pyeapi-0.8.4-py3-none-any.whl
Collecting textfsm
Using cached textfsm-1.1.2-py2.py3-none-any.whl (44 kB)
Collecting ciscoconfparse
Downloading ciscoconfparse-1.6.6-py3-none-any.whl (116 kB)
|████████████████████████████████| 116 kB 29.9 MB/s
Collecting scp
Using cached scp-0.14.1-py2.py3-none-any.whl (8.4 kB)
Collecting pycparser
Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Requirement already satisfied: pyparsing in ./venv/lib/python3.8/site-packages (from junos-eznc>=2.2.1->napalm) (3.0.6)
Collecting ncclient
Using cached ncclient-0.6.9-py2.py3-none-any.whl
Collecting pyserial
Downloading pyserial-3.5-py2.py3-none-any.whl (90 kB)
|████████████████████████████████| 90 kB 13.5 MB/s
Collecting yamlordereddictloader
Using cached yamlordereddictloader-0.4.0-py3-none-any.whl
Collecting transitions
Using cached transitions-0.8.10-py2.py3-none-any.whl (83 kB)
Requirement already satisfied: six in ./venv/lib/python3.8/site-packages (from junos-eznc>=2.2.1->napalm) (1.16.0)
Requirement already satisfied: MarkupSafe>=2.0 in ./venv/lib/python3.8/site-packages (from jinja2->napalm) (2.0.1)
Collecting tenacity
Using cached tenacity-8.0.1-py3-none-any.whl (24 kB)
Collecting ntc-templates
Using cached ntc_templates-3.0.0-py3-none-any.whl (303 kB)
Collecting bcrypt>=3.1.3
Using cached bcrypt-3.2.0-cp36-abi3-manylinux2010_x86_64.whl (63 kB)
Collecting pynacl>=1.0.1
Downloading PyNaCl-1.4.0-cp35-abi3-manylinux1_x86_64.whl (961 kB)
|████████████████████████████████| 961 kB 32.8 MB/s
Collecting cryptography>=2.5
Downloading cryptography-35.0.0-cp36-abi3-manylinux_2_24_x86_64.whl (3.5 MB)
|████████████████████████████████| 3.5 MB 51.9 MB/s
Requirement already satisfied: charset-normalizer~=2.0.0 in ./venv/lib/python3.8/site-packages (from requests>=2.7.0->napalm) (2.0.7)
Requirement already satisfied: idna<4,>=2.5 in ./venv/lib/python3.8/site-packages (from requests>=2.7.0->napalm) (3.3)
Requirement already satisfied: certifi>=2017.4.17 in ./venv/lib/python3.8/site-packages (from requests>=2.7.0->napalm) (2021.10.8)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./venv/lib/python3.8/site-packages (from requests>=2.7.0->napalm) (1.26.7)
Collecting ipaddr
Downloading ipaddr-2.2.0.tar.gz (26 kB)
Preparing metadata (setup.py) ... done
Collecting dnspython<3.0.0,>=2.1.0
Using cached dnspython-2.1.0-py3-none-any.whl (241 kB)
Collecting toml==0.10.2
Downloading toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting loguru==0.5.3
Using cached loguru-0.5.3-py3-none-any.whl (57 kB)
Collecting passlib<2.0.0,>=1.7.4
Using cached passlib-1.7.4-py2.py3-none-any.whl (525 kB)
Building wheels for collected packages: ipaddr
Building wheel for ipaddr (setup.py) ... done
Created wheel for ipaddr: filename=ipaddr-2.2.0-py3-none-any.whl size=18280 sha256=bfde9d87d142029fa91f09b1f03cc14600bd23f9d40199e2fa3c0adb5c55bef8
Stored in directory: /home/netbox/.cache/pip/wheels/38/59/0e/c20fbbd7969a095fa10b79bdde5d9852227f60bdbdd3a90b49
Successfully built ipaddr
Installing collected packages: pycparser, cffi, pynacl, future, cryptography, bcrypt, textfsm, paramiko, lxml, yamlordereddictloader, transitions, toml, tenacity, scp, pyserial, passlib, ntc-templates, ncclient, loguru, ipaddr, dnspython, pyeapi, netmiko, junos-eznc, ciscoconfparse, napalm
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/opt/netbox-3.0.10/venv/lib/python3.8/site-packages/pycparser'
Check the permissions.
I then get the error above. So maytbe it's a rights problem.
If I try again with sudo, it's listed!
napalm 3.3.1
WARNING: You are using pip version 21.0.1; however, version 21.3.1 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
I also noticed the warning about the pip version I don't get when running it as the netbox user. Does this mean I have two different versions of pip installed and a different one is used by each user?
Thanks again for your guidance, it's much appreciated.