napalm-automation / napalm

Network Automation and Programmability Abstraction Layer with Multivendor support
Apache License 2.0
2.25k stars 555 forks source link

ncclient mismatch version issue #1487

Closed FloLaco closed 2 years ago

FloLaco commented 3 years ago

Description of Issue/Question

ncclient version is not specified by napalm, so it will install the lastest (0.6.12), but the junos-eznc dependency specified 0.6.9, which is not compatible. Error when pip install : ERROR: junos-eznc 2.6.2 has requirement ncclient==0.6.9, but you'll have ncclient 0.6.12 which is incompatible.

It produce error in nornir with nornir-napalm.

image

Did you follow the steps from https://github.com/napalm-automation/napalm#faq

Setup

napalm version

(Paste verbatim output from pip freeze | grep napalm between quotes below)

napalm==3.3.1

Steps to Reproduce the Issue

pip install napalm==3.3.1

Error Traceback

(Paste the complete traceback of the exception between quotes below)

Collecting napalm==3.3.1
  Using cached https://files.pythonhosted.org/packages/20/a1/d3fe4b1d43d692d01b3acf2cec9b6e249db9b1b841fe198d2cc31f2e442d/napalm-3.3.1-py2.py3-none-any.whl
Collecting lxml>=4.3.0 (from napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/e5/d7/2d8b9e1d4fe05b8b72b3d2345d5a741b005640681482502b5ce3d8f020d4/lxml-4.6.3-cp38-cp38-manylinux1_x86_64.whl
Collecting netaddr (from napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/ff/cd/9cdfea8fc45c56680b798db6a55fa60a22e2d3d3ccf54fc729d083b50ce4/netaddr-0.8.0-py2.py3-none-any.whl
Collecting scp (from napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/71/cf/7f011df117ba66f20e8fe3acebac83170c5e43edfc7073cb9959b46e921a/scp-0.13.6-py2.py3-none-any.whl
Collecting textfsm (from napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/8e/74/e4f66bf3b3829e063b30501b586b1a489bd664b9066bf74650845e4c6352/textfsm-1.1.2-py2.py3-none-any.whl
Collecting cffi>=1.11.3 (from napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/80/a8/1562ce87c8cb8c736cbef40bc235f4a2ac7835822c231f717e3064dfcc93/cffi-1.14.6-cp38-cp38-manylinux1_x86_64.whl
Collecting jinja2 (from napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/80/21/ae597efc7ed8caaa43fb35062288baaf99a7d43ff0cf66452ddf47604ee6/Jinja2-3.0.1-py3-none-any.whl
Collecting requests>=2.7.0 (from napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/92/96/144f70b972a9c0eabbd4391ef93ccd49d0f2747f4f6a2a2738e99e5adc65/requests-2.26.0-py2.py3-none-any.whl
Collecting pyeapi>=0.8.2 (from napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/a2/30/05d37e23c3d718cccf475e6664afae37d96af6601c03d3c6eae4bb480ac4/pyeapi-0.8.4.tar.gz
Requirement already satisfied: setuptools>=38.4.0 in /script/virtualenv/florian_lacommare/.pyenv/versions/3.8.3/envs/testnornir4/lib/python3.8/site-packages (from napalm==3.3.1) (41.2.0)
Collecting netmiko>=3.1.0 (from napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/6c/79/ddb4891d2eec8e3048f748474d3de6fec7af5515477d8081a500aee70326/netmiko-3.4.0-py3-none-any.whl
Collecting ciscoconfparse (from napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/0e/1c/5186c991ebd4fd24566a7ecf6a3f88eea168e0e79b35b58c43684bec9bf9/ciscoconfparse-1.5.46-py3-none-any.whl
Collecting future (from napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/45/0b/38b06fd9b92dc2b68d58b75f900e97884c45bedd2ff83203d933cf5851c9/future-0.18.2.tar.gz
Collecting junos-eznc>=2.2.1 (from napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/af/fe/65d6049ededd129c96a307f3dbf214edf8831e2839c578704388b6d514f6/junos_eznc-2.6.2-py2.py3-none-any.whl
Collecting paramiko>=2.6.0 (from napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/95/19/124e9287b43e6ff3ebb9cdea3e5e8e88475a873c05ccdf8b7e20d2c4201e/paramiko-2.7.2-py2.py3-none-any.whl
Collecting pyYAML (from napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/70/96/c7245e551b1cb496bfb95840ace55ca60f20d3d8e33d70faf8c78a976899/PyYAML-5.4.1-cp38-cp38-manylinux1_x86_64.whl
Collecting ncclient (from napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/b4/fb/ea6e42afdc51e7f3db3df07e380617e878eba53fc4afb9c155474e4ca904/ncclient-0.6.12.tar.gz
Collecting six (from textfsm->napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.11.3->napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/ae/e7/d9c3a176ca4b02024debf82342dab36efadfc5776f9c8db077e8f6e71821/pycparser-2.20-py2.py3-none-any.whl
Collecting MarkupSafe>=2.0 (from jinja2->napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/68/ba/7a5ca0f9b4239e6fd846dd54c0b5928187355fa62fbdbd13e1c5942afae7/MarkupSafe-2.0.1-cp38-cp38-manylinux2010_x86_64.whl
Collecting certifi>=2017.4.17 (from requests>=2.7.0->napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/05/1b/0a0dece0e8aa492a6ec9e4ad2fe366b511558cdc73fd3abc82ba7348e875/certifi-2021.5.30-py2.py3-none-any.whl
Collecting charset-normalizer~=2.0.0; python_version >= "3" (from requests>=2.7.0->napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/33/53/b7f6126a2b9fd878b025fe3c40266cfaad696f312165008ce045bffa3fe7/charset_normalizer-2.0.4-py3-none-any.whl
Collecting idna<4,>=2.5; python_version >= "3" (from requests>=2.7.0->napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/d7/77/ff688d1504cdc4db2a938e2b7b9adee5dd52e34efbd2431051efc9984de9/idna-3.2-py3-none-any.whl
Collecting urllib3<1.27,>=1.21.1 (from requests>=2.7.0->napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/5f/64/43575537846896abac0b15c3e5ac678d787a4021e906703f1766bfb8ea11/urllib3-1.26.6-py2.py3-none-any.whl
Collecting pyserial (from netmiko>=3.1.0->napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/07/bc/587a445451b253b285629263eb51c2d8e9bcea4fc97826266d186f96f558/pyserial-3.5-py2.py3-none-any.whl
Collecting ntc-templates (from netmiko>=3.1.0->napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/72/2c/78207fb7efe282710283705f9bcb02b972515285241b7c43ceafbfcb417e/ntc_templates-2.2.2-py3-none-any.whl
Collecting tenacity (from netmiko>=3.1.0->napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/f2/a5/f86bc8d67c979020438c8559cc70cfe3a1643fd160d35e09c9cca6a09189/tenacity-8.0.1-py3-none-any.whl
Collecting passlib (from ciscoconfparse->napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/3b/a4/ab6b7589382ca3df236e03faa71deac88cae040af60c071a78d254a62172/passlib-1.7.4-py2.py3-none-any.whl
Collecting colorama (from ciscoconfparse->napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/44/98/5b86278fbbf250d239ae0ecb724f8572af1c91f4a11edf4d36a206189440/colorama-0.4.4-py2.py3-none-any.whl
Collecting dnspython (from ciscoconfparse->napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/f5/2d/ae9e172b4e5e72fa4b3cfc2517f38b602cc9ba31355f9669c502b4e9c458/dnspython-2.1.0-py3-none-any.whl
Collecting loguru (from ciscoconfparse->napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/6d/48/0a7d5847e3de329f1d0134baf707b689700b53bd3066a5a8cfd94b3c9fc8/loguru-0.5.3-py3-none-any.whl
Collecting transitions (from junos-eznc>=2.2.1->napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/3c/b6/56088011072ac038817b2a4d3e999fb92e07e0878330e13205f0de05ddf8/transitions-0.8.8-py2.py3-none-any.whl
Collecting pyparsing (from junos-eznc>=2.2.1->napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/8a/bb/488841f56197b13700afd5658fc279a2025a39e22449b7cf29864669b15d/pyparsing-2.4.7-py2.py3-none-any.whl
Collecting yamlordereddictloader (from junos-eznc>=2.2.1->napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/56/e1/1ca77da64cc355f0de483095e841d96f2366f93b095b83869440a296c21d/yamlordereddictloader-0.4.0.tar.gz
Collecting pynacl>=1.0.1 (from paramiko>=2.6.0->napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/9d/57/2f5e6226a674b2bcb6db531e8b383079b678df5b10cdaa610d6cf20d77ba/PyNaCl-1.4.0-cp35-abi3-manylinux1_x86_64.whl
Collecting cryptography>=2.5 (from paramiko>=2.6.0->napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/28/d4/35dc171f470704403e35d639b1b4ad38f6a6e07c39aab2fad9437b88d4c3/cryptography-3.4.8-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Collecting bcrypt>=3.1.3 (from paramiko>=2.6.0->napalm==3.3.1)
  Using cached https://files.pythonhosted.org/packages/26/70/6d218afbe4c73538053c1016dd631e8f25fffc10cd01f5c272d7acf3c03d/bcrypt-3.2.0-cp36-abi3-manylinux2010_x86_64.whl
ERROR: junos-eznc 2.6.2 has requirement ncclient==0.6.9, but you'll have ncclient 0.6.12 which is incompatible.
Installing collected packages: lxml, netaddr, pycparser, cffi, six, pynacl, cryptography, bcrypt, paramiko, scp, future, textfsm, MarkupSafe, jinja2, certifi, charset-normalizer, idna, urllib3, requests, pyeapi, pyserial, ntc-templates, tenacity, netmiko, passlib, colorama, dnspython, loguru, ciscoconfparse, pyYAML, transitions, pyparsing, ncclient, yamlordereddictloader, junos-eznc, napalm
  Running setup.py install for future ... done
  Running setup.py install for pyeapi ... done
  Running setup.py install for ncclient ... done
  Running setup.py install for yamlordereddictloader ... done
Successfully installed MarkupSafe-2.0.1 bcrypt-3.2.0 certifi-2021.5.30 cffi-1.14.6 charset-normalizer-2.0.4 ciscoconfparse-1.5.46 colorama-0.4.4 cryptography-3.4.8 dnspython-2.1.0 future-0.18.2 idna-3.2 jinja2-3.0.1 junos-eznc-2.6.2 loguru-0.5.3 lxml-4.6.3 napalm-3.3.1 ncclient-0.6.12 netaddr-0.8.0 netmiko-3.4.0 ntc-templates-2.2.2 paramiko-2.7.2 passlib-1.7.4 pyYAML-5.4.1 pycparser-2.20 pyeapi-0.8.4 pynacl-1.4.0 pyparsing-2.4.7 pyserial-3.5 requests-2.26.0 scp-0.13.6 six-1.16.0 tenacity-8.0.1 textfsm-1.1.2 transitions-0.8.8 urllib3-1.26.6 yamlordereddictloader-0.4.0
WARNING: You are using pip version 19.2.3, however version 21.2.4 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
FloLaco commented 3 years ago

The solution is to specify the version 0.6.9 on this line https://github.com/napalm-automation/napalm/blob/68a7c70f3c928db40749bf76d10944bd347b7f43/requirements.txt#L16

ktbyers commented 3 years ago

@FloLaco ncclient/pyez need to fix whatever the ongoing issue is between them i.e. it is not a good idea to pin to a downrev version of a library (especially for an extended period of time).

0.6.9 is already over a year old.

You probably should redirect this issue to PyEZ and/or ncclient (i.e. PyEZ shouldn't be pinning to downrev software and if ncclient is broken with respect to Juniper's NETCONF/PyEZ then that underlying issue really needs fixed).

mirceaulinic commented 2 years ago

pip install napalm (at least modern versions) should normally install ncclient 0.6.12, then downgrade to 0.6.9 because of the junos-eznc constraint. I can confirm this behaviour at least on Unix (don't have any Windows to test). Feel free to reopen if that still breaks your setup @FloLaco!