Pythonの初心者がよくはまるトラブルだと思いますが、
いろいろな書籍を参考にPythonを学んでいるうちに、
インストールされているPythonのバージョンの種類が増えていきます。
その状況を考慮せず、書籍には、ライブラリをインストールするときは
とするように書かれています。
複数のpythonが共存する環境で、このコマンドを実行すると、
おそらく、最新のバージョンにインストールされることになります。
この状況を確認する方法に関して説明します。
スポンサーリンク
Python 3.6、3.7、3.8がインストールされている状況で、
3.7と3.8にazure-cognitiveservices-vision-faceをインストールしました。
結果
Version: 0.4.0
Summary: Microsoft Azure Cognitive Services Face Client Library for Python
Home-page: https://github.com/Azure/azure-sdk-for-python
Author: Microsoft Corporation
Author-email: azpysdkhelp@microsoft.com
License: MIT License
Location: c:\users\user\appdata\local\programs\python\python38-32\lib\site-packages
Requires: azure-common, msrest
Required-by:
Locationのフォルダを見るとわかりますが、Python3.8にインストールされていることがわかります。
結果
Version: 0.4.0
Summary: Microsoft Azure Cognitive Services Face Client Library for Python
Home-page: https://github.com/Azure/azure-sdk-for-python
Author: Microsoft Corporation
Author-email: azpysdkhelp@microsoft.com
License: MIT License
Location: c:\users\user\anaconda3\lib\site-packages
Requires: azure-common, msrest
Required-by:
anaconda3はPython3.7のバージョンなので、Python3.7にインストールされていることがわかります。
結果
Python3.6にはインストールされていません。
pip listでも確認することができます。
例えば、バージョン3.7を指定する場合は以下です。