pip install SeleniumLibrary Note: you may need to restart the kernel to use updated packages. ERROR: Could not find a version that satisfies the requirement SeleniumLibrary (from versions: none) ERROR: No matching distribution found for SeleniumLibrary

robotframework
本ページはプロモーションが含まれています

はじめに

robotframeworkでSeleniumLibraryを使用しようとしてpip installを行うとエラーが出ました。
ライブラリのインストール方法で詰まったのでそのメモです。

エラーメッセージ

実行したコマンドは

pip install SeleniumLibrary

実行したのがAnacondaに付属しているSpyderのコンソール上から実行しました。
表示されたメッセージは以下の通りです。

pip install SeleniumLibrary Note: you may need to restart the kernel to use updated packages. ERROR: Could not find a version that satisfies the requirement SeleniumLibrary (from versions: none) ERROR: No matching distribution found for SeleniumLibrary

メッセージによると

SeleniumLibraryの条件を満たすバージョンが見つけられません。
そのようなディストリビューションは見つからなかった。

というものです。

対策

理由は単純でrobotframeworkのソースで書く場合はSeleniumLibraryを使用しますが、pip installだと名称が異なります。

pip installだと

pip install robotframework-seleniumlibrary

とする必要があります(ややこしい…名前を統一してほしいですね)

ちなみにpip installするコンソールによってエラーメッセージも異なる可能性があります。
今回はどうやらSpyderの場合このような表記になるようです。

さいごに

ということで今回はSeleniumLibraryのpip install方法についてでした。
たまにパッケージの名前とpip installで名前が一致しないことがありますよね。

今回はその例の一つでした。
この記事がお役に立ったなら嬉しいです。

最後までお読みいただきありがとうございました。

タイトルとURLをコピーしました