napalmが無いと言われたときの対処


NAPALMを含んだPythonコードを試している中でモジュールがないというエラーがでた。
その対処について記載。

```
python3 ./test.py 
Traceback (most recent call last):
  File "/root/PyNW/./testNAPALM.py", line 1, in <module>
    from napalm import get_network_driver
ModuleNotFoundError: No module named 'napalm'
```
（napalmモジュール見つからない）


モジュールのインストールを開始
```
#pip3 install napalm

Collecting napalm
  Using cached napalm-3.4.1-py2.py3-none-any.whl (256 kB)
Collecting ncclient
  Using cached ncclient-0.6.13.tar.gz (105 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: setuptools>=38.4.0 in /usr/local/lib/python3.10/site-packages (from napalm) (58.1.0)
Collecting pyYAML
  Downloading PyYAML-6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (682 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 682.2/682.2 kB 24.4 MB/s eta 0:00:00
Collecting requests>=2.7.0
  Downloading requests-2.28.0-py3-none-any.whl (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 kB 25.8 MB/s eta 0:00:00
Collecting jinja2
  Downloading Jinja2-3.1.2-py3-none-any.whl (133 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.1/133.1 kB 11.3 MB/s eta 0:00:00
Collecting paramiko>=2.6.0
  Using cached paramiko-2.11.0-py2.py3-none-any.whl (212 kB)
Collecting junos-eznc>=2.6.3
  Using cached junos_eznc-2.6.4-py2.py3-none-any.whl (197 kB)
Collecting future
  Using cached future-0.18.2.tar.gz (829 kB)
  Preparing metadata (setup.py) ... done
Collecting ciscoconfparse
  Using cached ciscoconfparse-1.6.40-py3-none-any.whl (136 kB)
Collecting scp
  Using cached scp-0.14.4-py2.py3-none-any.whl (8.6 kB)
Collecting textfsm
  Using cached textfsm-1.1.2-py2.py3-none-any.whl (44 kB)
Collecting pyeapi>=0.8.2
  Using cached pyeapi-0.8.4.tar.gz (138 kB)
  Preparing metadata (setup.py) ... done
Collecting netaddr
  Using cached netaddr-0.8.0-py2.py3-none-any.whl (1.9 MB)
Collecting lxml>=4.3.0
  Downloading lxml-4.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (6.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.9/6.9 MB 4.7 MB/s eta 0:00:00
Collecting cffi>=1.11.3
  Downloading cffi-1.15.0-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (446 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 446.3/446.3 kB 967.3 kB/s eta 0:00:00
Collecting netmiko<4.0.0,>=3.3.0
  Using cached netmiko-3.4.0-py3-none-any.whl (178 kB)
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Collecting pyserial
  Using cached pyserial-3.5-py2.py3-none-any.whl (90 kB)
Collecting yamlordereddictloader
  Using cached yamlordereddictloader-0.4.0.tar.gz (3.3 kB)
  Preparing metadata (setup.py) ... done
Collecting transitions
  Using cached transitions-0.8.11-py2.py3-none-any.whl (83 kB)
Collecting six
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting pyparsing
  Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
Collecting MarkupSafe>=2.0
  Downloading MarkupSafe-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
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 pynacl>=1.0.1
  Using cached PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB)
Collecting bcrypt>=3.1.3
  Using cached bcrypt-3.2.2-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (61 kB)
Collecting cryptography>=2.5
  Using cached cryptography-37.0.2-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB)
Collecting idna<4,>=2.5
  Using cached idna-3.3-py3-none-any.whl (61 kB)
Collecting charset-normalizer~=2.0.0
  Using cached charset_normalizer-2.0.12-py3-none-any.whl (39 kB)
Collecting certifi>=2017.4.17
  Downloading certifi-2022.6.15-py3-none-any.whl (160 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 160.2/160.2 kB 3.5 MB/s eta 0:00:00
Collecting urllib3<1.27,>=1.21.1
  Using cached urllib3-1.26.9-py2.py3-none-any.whl (138 kB)
Collecting dnspython<3.0.0,>=2.1.0
  Using cached dnspython-2.2.1-py3-none-any.whl (269 kB)
Collecting toml==0.10.2
  Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting loguru==0.6.0
  Using cached loguru-0.6.0-py3-none-any.whl (58 kB)
Collecting passlib<2.0.0,>=1.7.4
  Using cached passlib-1.7.4-py2.py3-none-any.whl (525 kB)
Using legacy 'setup.py install' for ncclient, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pyeapi, since package 'wheel' is not installed.
Using legacy 'setup.py install' for future, since package 'wheel' is not installed.
Using legacy 'setup.py install' for yamlordereddictloader, since package 'wheel' is not installed.
Installing collected packages: pyserial, passlib, netaddr, urllib3, toml, tenacity, six, pyYAML, pyparsing, pyeapi, pycparser, MarkupSafe, lxml, loguru, idna, future, dnspython, charset-normalizer, certifi, yamlordereddictloader, transitions, textfsm, requests, jinja2, ciscoconfparse, cffi, pynacl, ntc-templates, cryptography, bcrypt, paramiko, scp, ncclient, netmiko, junos-eznc, napalm
  Running setup.py install for pyeapi ... done
  Running setup.py install for future ... done
  Running setup.py install for yamlordereddictloader ... done
  Running setup.py install for ncclient ... done
Successfully installed MarkupSafe-2.1.1 bcrypt-3.2.2 certifi-2022.6.15 cffi-1.15.0 charset-normalizer-2.0.12 ciscoconfparse-1.6.40 cryptography-37.0.2 dnspython-2.2.1 future-0.18.2 idna-3.3 jinja2-3.1.2 junos-eznc-2.6.4 loguru-0.6.0 lxml-4.9.0 napalm-3.4.1 ncclient-0.6.13 netaddr-0.8.0 netmiko-3.4.0 ntc-templates-3.0.0 paramiko-2.11.0 passlib-1.7.4 pyYAML-6.0 pycparser-2.21 pyeapi-0.8.4 pynacl-1.5.0 pyparsing-3.0.9 pyserial-3.5 requests-2.28.0 scp-0.14.4 six-1.16.0 tenacity-8.0.1 textfsm-1.1.2 toml-0.10.2 transitions-0.8.11 urllib3-1.26.9 yamlordereddictloader-0.4.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
```

無事導入できた模様。