This is happening post textfsm update from 0.4.1 to 1.1.0.
(temp_virt) vsethuram-a01:temp vsethuram$ pip3 install netmiko
Collecting netmiko
Downloading https://files.pythonhosted.org/packages/07/c7/9a07543baa8489f28b8de8ad00bd83612bbe9b65f17af2fdfdf2d74da5c9/netmiko-2.4.0-py2.py3-none-any.whl (140kB)
|鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 143kB 752kB/s
Collecting pyyaml (from netmiko)
Collecting textfsm (from netmiko)
Using cached https://files.pythonhosted.org/packages/bd/27/0b149b6da3e47cc8daebace6920093114392171a8f5c24f1f2ad9a9e9c4d/textfsm-1.1.0-py2.py3-none-any.whl
Collecting pyserial (from netmiko)
Using cached https://files.pythonhosted.org/packages/0d/e4/2a744dd9e3be04a0c0907414e2a01a7c88bb3915cbe3c8cc06e209f59c30/pyserial-3.4-py2.py3-none-any.whl
Collecting paramiko>=2.4.3 (from netmiko)
Using cached https://files.pythonhosted.org/packages/4b/80/74dace9e48b0ef923633dfb5e48798f58a168e4734bca8ecfaf839ba051a/paramiko-2.6.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools>=38.4.0 in ./temp_virt/lib/python3.7/site-packages (from netmiko) (41.0.1)
Collecting scp>=0.13.2 (from netmiko)
Using cached https://files.pythonhosted.org/packages/4d/7a/3d76dc5ad8deea79642f50a572e1c057cb27e8b427f83781a2c05ce4e5b6/scp-0.13.2-py2.py3-none-any.whl
Collecting future (from textfsm->netmiko)
Collecting six (from textfsm->netmiko)
Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting pynacl>=1.0.1 (from paramiko>=2.4.3->netmiko)
Using cached https://files.pythonhosted.org/packages/cd/c9/4d6deea9d900345b1243cc3e6265110697fae5e594689cfa1ba34e0ef4a8/PyNaCl-1.3.0-cp34-abi3-macosx_10_6_intel.whl
Collecting bcrypt>=3.1.3 (from paramiko>=2.4.3->netmiko)
Using cached https://files.pythonhosted.org/packages/62/20/4c94f3f8dfc6b8720c8bc903ce2951ec6397ad864e3a64b4abdced014514/bcrypt-3.1.7-cp34-abi3-macosx_10_6_intel.whl
Collecting cryptography>=2.5 (from paramiko>=2.4.3->netmiko)
Using cached https://files.pythonhosted.org/packages/63/4e/57b7a6bd98906872fcd2531e74b532de2abe17d675a5cf171931fcb4a9e8/cryptography-2.7-cp34-abi3-macosx_10_6_intel.whl
Collecting cffi>=1.4.1 (from pynacl>=1.0.1->paramiko>=2.4.3->netmiko)
Using cached https://files.pythonhosted.org/packages/f0/48/5aa4ea664eba26dd5142558d04762f5065c02220b4665b3f7eecb9bb614e/cffi-1.12.3-cp37-cp37m-macosx_10_9_x86_64.whl
Collecting asn1crypto>=0.21.0 (from cryptography>=2.5->paramiko>=2.4.3->netmiko)
Using cached https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.4.1->pynacl>=1.0.1->paramiko>=2.4.3->netmiko)
Installing collected packages: pyyaml, future, six, textfsm, pyserial, pycparser, cffi, pynacl, bcrypt, asn1crypto, cryptography, paramiko, scp, netmiko
Successfully installed asn1crypto-0.24.0 bcrypt-3.1.7 cffi-1.12.3 cryptography-2.7 future-0.17.1 netmiko-2.4.0 paramiko-2.6.0 pycparser-2.19 pynacl-1.3.0 pyserial-3.4 pyyaml-5.1.1 scp-0.13.2 six-1.12.0 textfsm-1.1.0
(temp_virt) vsethuram-a01:temp vsethuram$
(temp_virt) vsethuram-a01:temp vsethuram$
(temp_virt) vsethuram-a01:temp vsethuram$ python
Python 3.7.3 (default, Mar 27 2019, 09:23:39)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import netmiko
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/vsethuram/temp/temp_virt/lib/python3.7/site-packages/netmiko/__init__.py", line 8, in <module>
from netmiko.ssh_dispatcher import ConnectHandler
File "/Users/vsethuram/temp/temp_virt/lib/python3.7/site-packages/netmiko/ssh_dispatcher.py", line 4, in <module>
from netmiko.a10 import A10SSH
File "/Users/vsethuram/temp/temp_virt/lib/python3.7/site-packages/netmiko/a10/__init__.py", line 2, in <module>
from netmiko.a10.a10_ssh import A10SSH
File "/Users/vsethuram/temp/temp_virt/lib/python3.7/site-packages/netmiko/a10/a10_ssh.py", line 4, in <module>
from netmiko.cisco_base_connection import CiscoSSHConnection
File "/Users/vsethuram/temp/temp_virt/lib/python3.7/site-packages/netmiko/cisco_base_connection.py", line 3, in <module>
from netmiko.base_connection import BaseConnection
File "/Users/vsethuram/temp/temp_virt/lib/python3.7/site-packages/netmiko/base_connection.py", line 32, in <module>
from netmiko.utilities import write_bytes, check_serial_port, get_structured_data
File "/Users/vsethuram/temp/temp_virt/lib/python3.7/site-packages/netmiko/utilities.py", line 10, in <module>
from netmiko._textfsm import _clitable as clitable
File "/Users/vsethuram/temp/temp_virt/lib/python3.7/site-packages/netmiko/_textfsm/__init__.py", line 3, in <module>
from netmiko._textfsm import _clitable
File "/Users/vsethuram/temp/temp_virt/lib/python3.7/site-packages/netmiko/_textfsm/_clitable.py", line 34, in <module>
import copyable_regex_object
ModuleNotFoundError: No module named 'copyable_regex_object'
>>>
temp_virt) vsethuram-a01:temp vsethuram$ pip freeze
asn1crypto==0.24.0
bcrypt==3.1.7
cffi==1.12.3
cryptography==2.7
future==0.17.1
netmiko==2.4.0
paramiko==2.6.0
pycparser==2.19
PyNaCl==1.3.0
pyserial==3.4
PyYAML==5.1.1
scp==0.13.2
six==1.12.0
textfsm==1.1.0
Hello,
Same problem for me :
File "/usr/local/lib/python3.7/site-packages/netmiko/_textfsm/_clitable.py", line 34, in <module>
import copyable_regex_object
ModuleNotFoundError: No module named 'copyable_regex_object'
I hadn't this problem before the update.
As a workaround, you can downgrade the textfsm module to version 0.4.1 with the following command:
sudo pip3 install --upgrade textfsm==0.4.1
Yes, the Netmiko-textfsm issue is fixed in the Netmiko develop branch.
Alternatively, you can pip install textfsm==0.4.1. The underlying issue is that TextFSM changed their library structure which affected some things Netmiko is doing and Netmiko had only recently implemented a fix for this.
I will try to push out a new release of Netmiko in the next few days.
Thanks @ktbyers @carlniger @thearch1tech
I released Netmiko 2.4.1 today that fixes this issue.
Most helpful comment
Yes, the Netmiko-textfsm issue is fixed in the Netmiko develop branch.
Alternatively, you can pip install textfsm==0.4.1. The underlying issue is that TextFSM changed their library structure which affected some things Netmiko is doing and Netmiko had only recently implemented a fix for this.
I will try to push out a new release of Netmiko in the next few days.