kazuuu.net

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

【Python用クライアント】Socket.IOサーバー「python-socketio」のインストール

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

【Python用クライアント】Socket.IOサーバー「python-socketio」のインストールについて解説しています。

「python-socketio(https://github.com/miguelgrinberg/python-socketio)」は、Socket.IO_リアルタイムクライアント及びサーバーのPython実装ができるライブラリです。

■Python

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

■python-socketioをインストールする

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

pip install python-socketio

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

なお、今回は、pythonランチャーを使用しており、Python Version 3.8.5にインストールを行うために、pipを使う場合にはコマンドでの切り替えを行います。

py -3.8 -m pip install python-socketio

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

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

Collecting python-socketio

Downloading python_socketio-5.5.2-py3-none-any.whl (56 kB)

|████████████████████████████████| 56 kB 762 kB/s

Collecting bidict>=0.21.0

Downloading bidict-0.21.4-py3-none-any.whl (36 kB)

Collecting python-engineio>=4.3.0

Downloading python_engineio-4.3.1-py3-none-any.whl (52 kB)

|████████████████████████████████| 52 kB 489 kB/s

Installing collected packages: python-engineio, bidict, python-socketio

Successfully installed bidict-0.21.4 python-engineio-4.3.1 python-socketio-5.5.2

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

なお、今回はpython-socketioのバージョン2.6.1をインストールしました。