webmaster-kazu.com

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

ランタイムを備えた非同期Python高速なWebサーバー「robyn」のインストール

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

Rustで記述されたランタイムを備えた非同期Python高速なWebサーバー「robyn」のインストールについて解説しています。

「robyn(https://github.com/sansyrox/robyn)」は、Rustで記述されたランタイムを備えた非同期Pythonバックエンドサーバーで、シンプルなAPIの作成などを行えます。

■Python

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

■robynをインストールする

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

pip install robyn

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

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

py -3.8 -m pip install robyn

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

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

Collecting robyn

Downloading robyn-0.17.0-cp38-none-win_amd64.whl (2.6 MB)

---------------------------------------- 2.6/2.6 MB 2.1 MB/s eta 0:00:00

Collecting watchdog==2.1.3

Downloading watchdog-2.1.3-py3-none-win_amd64.whl (75 kB)

---------------------------------------- 75.0/75.0 kB 4.0 MB/s eta 0:00:00

Collecting multiprocess==0.70.12.2

Downloading multiprocess-0.70.12.2-py38-none-any.whl (128 kB)

---------------------------------------- 128.3/128.3 kB 7.4 MB/s eta 0:00:00

Requirement already satisfied: dill>=0.3.4 in c:\users\user_\appdata\roaming\python\python38\site-packages (from multiprocess==0.70.12.2->robyn) (0.3.4)

Installing collected packages: watchdog, multiprocess, robyn

Attempting uninstall: watchdog

Found existing installation: watchdog 2.1.2

Uninstalling watchdog-2.1.2:

Successfully uninstalled watchdog-2.1.2

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.

streamlit 0.82.0 requires click<8.0,>=7.0, but you have click 8.1.3 which is incompatible.

Successfully installed multiprocess-0.70.12.2 robyn-0.17.0 watchdog-2.1.3

Enterキーを押すと、インストールが開始され、上記のように「Successfully installed」と表示され、今回はrobynのバージョン0.17.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.(ERROR: pip の依存性解決は現在インストールされているすべてのパッケージを考慮に入れていません。この挙動は以下のような依存関係の衝突の原因となっています。)」というエラーが出力されてしまいました。エラーの内容から、robynをインストールする際は仮想環境を構築しインストールされることを推奨します。