webmaster-kazu.com

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

SingleStoreデータベースおよびワークスペース管理 API へのPythonインターフェイス「singlestoredb」のインストール

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

SingleStoreデータベースおよびワークスペース管理 API へのPythonインターフェイス「singlestoredb」のインストールについて解説しています。

「singlestoredb(https://github.com/singlestore-labs/singlestoredb-python)」は、SingleStoreデータベースへの接続などが行えるPythonライブラリです。

■Python

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

■singlestoredbをインストールする

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

pip install singlestoredb

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

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

py -3.8 -m pip install singlestoredb

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

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

Collecting singlestoredb

Downloading singlestoredb-0.4.0-py3-none-any.whl (171 kB)

---------------------------------------- 171.5/171.5 kB 1.1 MB/s eta 0:00:00

Requirement already satisfied: requests in c:\users\user_\appdata\roaming\python\python38\site-packages (from singlestoredb) (2.28.1)

Collecting PyMySQL

Using cached PyMySQL-1.0.2-py3-none-any.whl (43 kB)

Collecting sqlparams

Downloading sqlparams-5.0.0-py3-none-any.whl (16 kB)

Collecting PyJWT

Downloading PyJWT-2.6.0-py3-none-any.whl (20 kB)

Requirement already satisfied: idna<4,>=2.5 in c:\users\user_\appdata\roaming\python\python38\site-packages (from requests->singlestoredb) (3.4)

Requirement already satisfied: charset-normalizer<3,>=2 in c:\users\user_\appdata\roaming\python\python38\site-packages (from requests->singlestoredb) (2.1.1)

Requirement already satisfied: certifi>=2017.4.17 in c:\users\user_\appdata\roaming\python\python38\site-packages (from requests->singlestoredb) (2022.9.24)

Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\user_\appdata\roaming\python\python38\site-packages (from requests->singlestoredb) (1.26.12)

Installing collected packages: sqlparams, PyMySQL, PyJWT, singlestoredb

Successfully installed PyJWT-2.6.0 PyMySQL-1.0.2 singlestoredb-0.4.0 sqlparams-5.0.0

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

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