webmaster-kazu.com

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

Windows用のPython高性能スクリーンショットライブラリ「dxcam」のインストール

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

Windows用のPython高性能スクリーンショットライブラリ「dxcam」のインストールについて解説しています。

「dxcam(https://github.com/ra1nty/DXcam)」は、Desktop Duplication APIを使用したWindows 用のPython高性能スクリーンショットライブラリで、高速な画面キャプチャやNumPy、OpenCV、PyTorchなどのライブラリとの統合が可能です。

■Python

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

■dxcamをインストールする

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

pip install dxcam

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

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

py -3.8 -m pip install dxcam

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

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

Collecting dxcam

Downloading dxcam-0.0.5-py3-none-any.whl (20 kB)

Collecting comtypes

Downloading comtypes-1.1.14-py2.py3-none-any.whl (172 kB)

---------------------------------------- 172.8/172.8 kB 1.3 MB/s eta 0:00:00

Collecting numpy

Downloading numpy-1.23.3-cp38-cp38-win_amd64.whl (14.7 MB)

---------------------------------------- 14.7/14.7 MB 4.3 MB/s eta 0:00:00

Collecting opencv-python

Using cached opencv_python-4.6.0.66-cp36-abi3-win_amd64.whl (35.6 MB)

Installing collected packages: comtypes, numpy, opencv-python, dxcam

Successfully installed comtypes-1.1.14 dxcam-0.0.5 numpy-1.23.3 opencv-python-4.6.0.66

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

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