リストとセットのハイブリッドである変更可能なデータ構造「OrderedSet」のインストールについて解説しています。
「OrderedSet(https://github.com/rspeer/ordered-set)」は、Pythonで使用できる順序を記憶するカスタム MutableSet、またはエントリの順序を記憶する変更可能なセットです。
■Python
今回のPythonのバージョンは、「3.8.5」を使用しています。(Windows10)(pythonランチャーでの確認)
■OrderedSetをインストールする
OrderedSetをインストールを行いますが、今回はpipを経由してインストールを行うので、まずWindowsのコマンドプロンプトを起動します。
pip install ordered-set
起動後、上記のコマンドを入力し、Enterキーを押します。
なお、今回は、pythonランチャーを使用しており、Python Version 3.8.5にインストールを行うために、バージョンの切り替えを行います。
py -3.8 -m pip install ordered-set
切り替えるために、上記のコマンドを入力し、Enterキーを押します。
Defaulting to user installation because normal site-packages is not writeable Collecting ordered-set Downloading ordered_set-4.1.0-py3-none-any.whl (7.6 kB) Installing collected packages: ordered-set Successfully installed ordered-set-4.1.0 WARNING: You are using pip version 22.0.4; however, version 22.3.1 is available. You should consider upgrading via the 'C:\Program Files\Python39\python.exe -m pip install --upgrade pip' command.
Enterキーを押すと、インストールが開始され、上記のように「Successfully installed」と表示されます。これが表示されれば、ordered-setが正常にインストールされたことになります。ちなみに今回は「WARNING」が出力されましたがあくまでもWARNING(警告)であり、ERROR(エラー)ではないので、一旦無視しています。
なお、今回はordered-setのバージョン4.1.0をインストールしました。
コメント