webmaster-kazu.com

テクノロジー・データ分析・実践ログ・その他

Webブラウザを検出して起動するためのPythonライブラリ「pybrowsers」のインストール

カテゴリ: Python【初歩から現場実務的なもの】

Webブラウザを検出して起動するためのPythonライブラリ「pybrowsers」のインストールについて解説しています。

「pybrowsers(URL:https://pypi.org/project/pybrowsers/)」は、Webブラウザを起動したり、ブラウザの情報を取得することができます。

■Python

今回のPythonのバージョンは、「3.8.5」を使用しています。(Windows10)(pythonランチャーでの確認)

■pybrowsersをインストールする

pybrowsersをインストールを行いますが、今回はpipを経由してインストールを行うので、まずWindowsのコマンドプロンプトを起動します。

pip install pybrowsers

起動後、上記のコマンドを入力し、Enterキーを押します。

なお、今回は、pythonランチャーを使用しており、Python Version 3.8.5にインストールを行うために、バージョンの切り替えを行います。

py -3.8 -m pip install pybrowsers

切り替えるために、上記のコマンドを入力し、Enterキーを押します。

Defaulting to user installation because normal site-packages is not writeable

Collecting pybrowsers

Downloading pybrowsers-0.3.0-py3-none-any.whl (7.1 kB)

Collecting pywin32<304,>=303

Using cached pywin32-303-cp38-cp38-win_amd64.whl (9.3 MB)

Installing collected packages: pywin32, pybrowsers

Attempting uninstall: pywin32

Found existing installation: pywin32 301

Uninstalling pywin32-301:

Successfully uninstalled pywin32-301

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.

web3 5.24.0 requires jsonschema<4.0.0,>=3.2.0, but you have jsonschema 4.4.0 which is incompatible.

web3 5.24.0 requires websockets<10,>=9.1, but you have websockets 10.2 which is incompatible.

Successfully installed pybrowsers-0.3.0 pywin32-303

Enterキーを押すと、インストールが開始され、上記のように「Successfully installed」と表示されます。これが表示されれば、pybrowsersが正常にインストールされたことになります。

しかし、今回は「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.(エラー:pipの依存関係リゾルバーは、現在インストールされているすべてのパッケージを考慮していません。この動作は、次の依存関係の競合の原因です。)」という依存関係の競合の原因でエラーが発生してしまっているので、仮想環境を作成し、インストールすることを推奨します。

なお、今回は、pybrowsersのバージョン0.3.0をインストールしました。