0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

pyATSのversion update後のエラー対応

Last updated at Posted at 2021-05-13

はじめに

pyATSとはciscoが無償で提供しているマルチベンダー対応のテストフレームワークです。
pyATSにて何ができるのかを確かめるため、これもciscoが提供しているsandboxにてpyATSを触ってみました。
動作確認前のセットアップの際、pyats version update後にpyatsコマンドが実行できなくなったため対処を残しておきます。

環境

  • sandbox labs中のCisco pyATS XPRESSOのラボを利用
  • 操作端末はDevboxサーバ(10.10.20.50)

経緯

  1. ラボがActiveになり使用環境が整い、Devnetサーバへログイン
  2. pyatsのversionを確認後、最新のversionへupdateしたところ、updateは問題なく完了
  3. 直後のpyatsコマンドが実行できなくなる
    pyatsコマンドが実行できなくなる
実行ログ
(py3venv) [developer@devbox ~]$ pyats version check
You are currently running pyATS version: 20.8
Python: 3.6.8 [64bit]

 Package                      Version
 ---------------------------- -------
 genie                        20.8
 genie.libs.clean             20.8.1
 genie.libs.conf              20.8
 genie.libs.filetransferutils 20.8
 genie.libs.health            20.8
 genie.libs.ops               20.8
 genie.libs.parser            20.8
 genie.libs.robot             20.8
 genie.libs.sdk               20.8.2
 genie.telemetry              20.8
 genie.trafficgen             20.8
 pyats                        20.8
 pyats.aereport               20.8
 pyats.aetest                 20.8
 pyats.async                  20.8
 pyats.connections            20.8
 pyats.contrib                20.8
 pyats.datastructures         20.8
 pyats.easypy                 20.8
 pyats.kleenex                20.8.2
 pyats.log                    20.8
 pyats.reporter               20.8
 pyats.results                20.8
 pyats.robot                  20.8
 pyats.tcl                    20.8
 pyats.topology               20.8
 pyats.utils                  20.8
 unicon                       20.8.1
 unicon.plugins               20.8.1


(py3venv) [developer@devbox ~]$ pyats version update
Checking your current environment...


The following packages will be removed:

 Package                      Version
 ---------------------------- -------
 genie                        20.8
 genie.libs.clean             20.8.1
 genie.libs.conf              20.8
 genie.libs.filetransferutils 20.8
 genie.libs.health            20.8
 genie.libs.ops               20.8
 genie.libs.parser            20.8
 genie.libs.robot             20.8
 genie.libs.sdk               20.8.2
 genie.telemetry              20.8
 genie.trafficgen             20.8
 pyats                        20.8
 pyats.aereport               20.8
 pyats.aetest                 20.8
 pyats.async                  20.8
 pyats.connections            20.8
 pyats.contrib                20.8
 pyats.datastructures         20.8
 pyats.easypy                 20.8
 pyats.kleenex                20.8.2
 pyats.log                    20.8
 pyats.reporter               20.8
 pyats.results                20.8
 pyats.robot                  20.8
 pyats.tcl                    20.8
 pyats.topology               20.8
 pyats.utils                  20.8
 unicon                       20.8.1
 unicon.plugins               20.8.1


... and updated with:

 Package Version
 ------- -------
 ats     latest
 genie   latest
 unicon  latest


Are you sure to continue [y/N]? y
Uninstalling existing packages...
Installing new packages...

Done! Enjoy!

(py3venv) [developer@devbox ~]$ pyats version check
Traceback (most recent call last):
 File "/home/developer/py3venv/bin/pyats", line 8, in <module>
   sys.exit(main())
 File "src/pyats/cli/__main__.py", line 29, in pyats.cli.__main__.main
 File "src/pyats/cli/core.py", line 38, in pyats.cli.core.CLI.__init__
 File "src/pyats/cli/core.py", line 79, in pyats.cli.core.CLI.load_commands
 File "/home/developer/py3venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2345, in load
   self.require(*args, **kwargs)
 File "/home/developer/py3venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2368, in require
   items = working_set.resolve(reqs, env, installer, extras=self.extras)
 File "/home/developer/py3venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 789, in resolve
   raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (Jinja2 2.11.2 (/home/developer/py3venv/lib/python3.6/site-packages), Requirement.parse('Jinja2==2.11.3'))

原因

pyats version update時に依存するパッケージのversionと競合。要求されるversionとミスマッチしている。

pkg_resources.VersionConflict: (Jinja2 2.11.2 (/home/developer/py3venv/lib/python3.6/site-packages), Requirement.parse('Jinja2==2.11.3'))

対処

  • パッケージのアップデート前にpip自体をアップデート
(py3venv) [developer@devbox ~]$ pip install --upgrade pip
Collecting pip
  Downloading pip-21.1.1-py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 1.1 MB/s
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.2.3
    Uninstalling pip-20.2.3:
      Successfully uninstalled pip-20.2.3
Successfully installed pip-21.1.1

  • 求められるパッケージを指定のversionにアップデート
(py3venv) [developer@devbox ~]$ pip install -U Jinja2==2.11.3
Collecting Jinja2==2.11.3
  Downloading Jinja2-2.11.3-py2.py3-none-any.whl (125 kB)
     |████████████████████████████████| 125 kB 1.1 MB/s
Requirement already satisfied: MarkupSafe>=0.23 in ./py3venv/lib/python3.6/site-packages (from Jinja2==2.11.3) (2.0.0)
Installing collected packages: Jinja2
  Attempting uninstall: Jinja2
    Found existing installation: Jinja2 3.0.0
    Uninstalling Jinja2-3.0.0:
      Successfully uninstalled Jinja2-3.0.0
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
cookiecutter 1.7.2 requires MarkupSafe<2.0.0, but you have markupsafe 2.0.0 which is incompatible.
aiohttp-swagger 1.0.15 requires markupsafe~=1.1.1, but you have markupsafe 2.0.0 which is incompatible.
Successfully installed Jinja2-2.11.3

Jinja2自体のアップグレードには成功しましたが、今度はMarkupSafeのパッケージが競合でエラーが起きてます。

  • 同様に指定のバージョンへアップデート
(py3venv) [developer@devbox ~]$ pip install -U markupsafe==1.1.1
Collecting markupsafe==1.1.1
  Downloading MarkupSafe-1.1.1-cp36-cp36m-manylinux2010_x86_64.whl (32 kB)
Installing collected packages: markupsafe
  Attempting uninstall: markupsafe
    Found existing installation: MarkupSafe 2.0.0
    Uninstalling MarkupSafe-2.0.0:
      Successfully uninstalled MarkupSafe-2.0.0
Successfully installed markupsafe-1.1.1
  • pyatsコマンドが通るようになりました
(py3venv) [developer@devbox ~]$ pyats version check
You are currently running pyATS version: 21.4
Python: 3.6.8 [64bit]

  Package                      Version
  ---------------------------- -------
  genie                        21.4
  genie.libs.clean             21.4
  genie.libs.conf              21.4
  genie.libs.filetransferutils 21.4
  genie.libs.health            21.4.2
  genie.libs.ops               21.4
  genie.libs.parser            21.4
  genie.libs.robot             21.4
  genie.libs.sdk               21.4.1
  genie.telemetry              21.4
  genie.trafficgen             21.4
  pyats                        21.4
  pyats.aereport               21.4
  pyats.aetest                 21.4
  pyats.async                  21.4
  pyats.connections            21.4
  pyats.contrib                21.4
  pyats.datastructures         21.4
  pyats.easypy                 21.4
  pyats.kleenex                21.4
  pyats.log                    21.4
  pyats.reporter               21.4
  pyats.results                21.4
  pyats.robot                  21.4
  pyats.tcl                    21.4
  pyats.topology               21.4
  pyats.utils                  21.4
  unicon                       21.4
  unicon.plugins               21.4

さいごに

version update後にEnjoy!と出たのに、コマンド通らずで本当にITに向いていないと思う。。Enjoy勢?になれない。
初手で躓いたので備忘録。Linuxの知識が無さすぎて本筋とは関係のないところで問題解決に時間がかかってしまいます。。
英語が読めないのでさらりと流してしまうところですが、まずは表示されているエラーの内容をきちんと確認するようにした方が早く解決できる気がします。
これからpyATSをEnjoyします!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?