Nornir – macOS Big Sur

I had a simple backup script (backup-script.py) for a multiple vendor device environment. The script was working fine before and failed after I upgraded my mac OS to Big Sur, 11.0.1.

macOS Big Sur, 11.0.1
Python 3.8.6

Traceback (most recent call last):
File "backup-script.py", line 2, in
from nornir import InitNornir
File "/Users/lib/python3.8/site-packages/nornir/__init__.py", line 3, in
from nornir.init_nornir import InitNornir
File "/Users/lib/python3.8/site-packages/nornir/init_nornir.py", line 8, in
from nornir.plugins.connections.napalm import Napalm
File "/Users/lib/python3.8/site-packages/nornir/plugins/connections/napalm.py", line 3, in
from napalm import get_network_driver
File "/Users/lib/python3.8/site-packages/napalm/__init__.py", line 3, in
from napalm.base import get_network_driver
File "/Users/lib/python3.8/site-packages/napalm/base/__init__.py", line 27, in
from napalm.base.base import NetworkDriver
File "/Users/lib/python3.8/site-packages/napalm/base/base.py", line 21, in
from netmiko import ConnectHandler, NetMikoTimeoutException
File "/Users/lib/python3.8/site-packages/netmiko/__init__.py", line 8, in
from netmiko.ssh_dispatcher import ConnectHandler
File "/Users/lib/python3.8/site-packages/netmiko/ssh_dispatcher.py", line 4, in
from netmiko.a10 import A10SSH
File "/Users/lib/python3.8/site-packages/netmiko/a10/__init__.py", line 2, in
from netmiko.a10.a10_ssh import A10SSH
File "/Users/lib/python3.8/site-packages/netmiko/a10/a10_ssh.py", line 4, in
from netmiko.cisco_base_connection import CiscoSSHConnection
File "/Users/lib/python3.8/site-packages/netmiko/cisco_base_connection.py", line 3, in
from netmiko.base_connection import BaseConnection
File "/Users/lib/python3.8/site-packages/netmiko/base_connection.py", line 32, in
from netmiko.utilities import (
File "/Users/lib/python3.8/site-packages/netmiko/utilities.py", line 9, in
import serial.tools.list_ports
File "/Users/lib/python3.8/site-packages/serial/tools/list_ports.py", line 29, in
from serial.tools.list_ports_posix import comports
File "/Users/lib/python3.8/site-packages/serial/tools/list_ports_posix.py", line 31, in
from serial.tools.list_ports_osx import comports
File "/Users/lib/python3.8/site-packages/serial/tools/list_ports_osx.py", line 32, in
kIOMasterPortDefault = ctypes.c_void_p.in_dll(iokit, "kIOMasterPortDefault")

Reinstalling pyserial fixed the problem.

pip3 uninstall pyserial
pip3 install pyserial