webmaster-kazu.com

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

pocketbaseバックエンドのためのPython client SDKである「pocketbase」のインストール

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

pocketbaseバックエンドのためのPython client SDKである「pocketbase」のインストールについて解説しています。

「pocketbase(https://github.com/vaphes/pocketbase)」は、リアルタイムの組み込みデータベース(SQLite)で構成されるオープンソースバックエンド「pocketbase」のためのPython client SDKです。

■Python

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

■pocketbaseをインストールする

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

pip install pocketbase

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

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

py -3.8 -m pip install pocketbase

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

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

Collecting pocketbase

Downloading pocketbase-0.2.2-py3-none-any.whl (21 kB)

Collecting httpx<0.24.0,>=0.23.0

Downloading httpx-0.23.3-py3-none-any.whl (71 kB)

---------------------------------------- 71.5/71.5 kB ? eta 0:00:00

Requirement already satisfied: certifi in c:\users\user_\appdata\roaming\python\python38\site-packages (from httpx<0.24.0,>=0.23.0->pocketbase) (2022.12.7)

Collecting rfc3986[idna2008]<2,>=1.3

Using cached rfc3986-1.5.0-py2.py3-none-any.whl (31 kB)

Collecting sniffio

Using cached sniffio-1.3.0-py3-none-any.whl (10 kB)

Collecting httpcore<0.17.0,>=0.15.0

Downloading httpcore-0.16.3-py3-none-any.whl (69 kB)

---------------------------------------- 69.6/69.6 kB 956.8 kB/s eta 0:00:00

Collecting anyio<5.0,>=3.0

Downloading anyio-3.6.2-py3-none-any.whl (80 kB)

---------------------------------------- 80.6/80.6 kB 1.5 MB/s eta 0:00:00

Collecting h11<0.15,>=0.13

Using cached h11-0.14.0-py3-none-any.whl (58 kB)

Requirement already satisfied: idna in c:\users\user_\appdata\roaming\python\python38\site-packages (from rfc3986[idna2008]<2,>=1.3->httpx<0.24.0,>=0.23.0->pocketbase) (3.4)

Installing collected packages: rfc3986, sniffio, h11, anyio, httpcore, httpx, pocketbase

Successfully installed anyio-3.6.2 h11-0.14.0 httpcore-0.16.3 httpx-0.23.3 pocketbase-0.2.2 rfc3986-1.5.0 sniffio-1.3.0

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

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