Google Cloud Storage APIクライアントライブラリ「google-cloud-storage」のインストール

スポンサーリンク

Google Cloud Storage APIクライアントライブラリ「google-cloud-storage」のインストールについて解説しています。

「google-cloud-storage(https://github.com/googleapis/python-storage)」は、Google Cloud Storageを使用できます。このGoogle Cloud Storageを使用することで、高い信頼性、パフォーマンス、可用性を備えたGoogleインフラストラクチャにデータを保存することなどが可能になります。

■Python

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

■google-cloud-storageをインストールする

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

pip install google-cloud-storage

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

なお、今回は、pythonランチャーを使用しており、Python Version 3.8.5にインストールを行うために、pipを使う場合にはコマンドでの切り替えを行います。

py -3.8 -m pip install google-cloud-storage

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

Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: google-cloud-storage in c:\users\user_\appdata\roaming\python\python38\site-packages (1.40.0)
Requirement already satisfied: google-cloud-core<2.0dev,>=1.4.1 in c:\users\user_\appdata\roaming\python\python38\site-packages (from google-cloud-storage) (1.7.1)
Requirement already satisfied: google-resumable-media<2.0dev,>=1.3.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from google-cloud-storage) (1.3.1)
Requirement already satisfied: google-auth<2.0dev,>=1.11.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from google-cloud-storage) (1.32.1)
Requirement already satisfied: requests<3.0.0dev,>=2.18.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from google-cloud-storage) (2.26.0)
Requirement already satisfied: setuptools>=40.3.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from google-auth<2.0dev,>=1.11.0->google-cloud-storage) (62.3.3)
Requirement already satisfied: rsa<5,>=3.1.4 in c:\users\user_\appdata\roaming\python\python38\site-packages (from google-auth<2.0dev,>=1.11.0->google-cloud-storage) (4.7.2)
Requirement already satisfied: six>=1.9.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from google-auth<2.0dev,>=1.11.0->google-cloud-storage) (1.12.0)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from google-auth<2.0dev,>=1.11.0->google-cloud-storage) (4.2.2)
Requirement already satisfied: pyasn1-modules>=0.2.1 in c:\users\user_\appdata\roaming\python\python38\site-packages (from google-auth<2.0dev,>=1.11.0->google-cloud-storage) (0.2.8)
Collecting google-api-core<2.0.0dev,>=1.21.0
Downloading google_api_core-1.31.6-py2.py3-none-any.whl (93 kB)
---------------------------------------- 93.3/93.3 kB 1.1 MB/s eta 0:00:00
Requirement already satisfied: google-crc32c<2.0dev,>=1.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from google-resumable-media<2.0dev,>=1.3.0->google-cloud-storage) (1.1.2)
Requirement already satisfied: idna<4,>=2.5 in c:\users\user_\appdata\roaming\python\python38\site-packages (from requests<3.0.0dev,>=2.18.0->google-cloud-storage) (3.2)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\user_\appdata\roaming\python\python38\site-packages (from requests<3.0.0dev,>=2.18.0->google-cloud-storage) (1.26.6)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\user_\appdata\roaming\python\python38\site-packages (from requests<3.0.0dev,>=2.18.0->google-cloud-storage) (2021.5.30)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from requests<3.0.0dev,>=2.18.0->google-cloud-storage) (2.0.2)
Requirement already satisfied: packaging>=14.3 in c:\users\user_\appdata\roaming\python\python38\site-packages (from google-api-core<2.0.0dev,>=1.21.0->google-cloud-core<2.0dev,>=1.4.1->google-cloud-storage) (21.3)
Collecting six>=1.9.0
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Requirement already satisfied: pytz in c:\users\user_\appdata\roaming\python\python38\site-packages (from google-api-core<2.0.0dev,>=1.21.0->google-cloud-core<2.0dev,>=1.4.1->google-cloud-storage) (2021.3)
Requirement already satisfied: googleapis-common-protos<2.0dev,>=1.6.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from google-api-core<2.0.0dev,>=1.21.0->google-cloud-core<2.0dev,>=1.4.1->google-cloud-storage) (1.53.0)
Requirement already satisfied: protobuf<4.0.0dev,>=3.12.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from google-api-core<2.0.0dev,>=1.21.0->google-cloud-core<2.0dev,>=1.4.1->google-cloud-storage) (3.17.3)
Requirement already satisfied: cffi>=1.0.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from google-crc32c<2.0dev,>=1.0->google-resumable-media<2.0dev,>=1.3.0->google-cloud-storage) (1.15.0)
Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in c:\users\user_\appdata\roaming\python\python38\site-packages (from pyasn1-modules>=0.2.1->google-auth<2.0dev,>=1.11.0->google-cloud-storage) (0.4.8)
Requirement already satisfied: pycparser in c:\users\user_\appdata\roaming\python\python38\site-packages (from cffi>=1.0.0->google-crc32c<2.0dev,>=1.0->google-resumable-media<2.0dev,>=1.3.0->google-cloud-storage) (2.21)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in c:\users\user_\appdata\roaming\python\python38\site-packages (from packaging>=14.3->google-api-core<2.0.0dev,>=1.21.0->google-cloud-core<2.0dev,>=1.4.1->google-cloud-storage) (2.3.1)
Installing collected packages: six, google-api-core
Attempting uninstall: six
Found existing installation: six 1.12.0
Uninstalling six-1.12.0:
Successfully uninstalled six-1.12.0
Attempting uninstall: google-api-core
Found existing installation: google-api-core 2.7.1
Uninstalling google-api-core-2.7.1:
Successfully uninstalled google-api-core-2.7.1
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.
xhtml2pdf 0.2.5 requires html5lib>=1.0, but you have html5lib 1.0b10 which is incompatible.
textract 1.6.5 requires six~=1.12.0, but you have six 1.16.0 which is incompatible.
tensorflow 2.5.0 requires numpy~=1.19.2, but you have numpy 1.21.5 which is incompatible.
tensorflow 2.5.0 requires six~=1.15.0, but you have six 1.16.0 which is incompatible.
tensorflow 2.5.0 requires typing-extensions~=3.7.4, but you have typing-extensions 4.0.0 which is incompatible.
seleniumbase 3.1.0 requires beautifulsoup4==4.11.1; python_version >= "3.6", but you have beautifulsoup4 4.8.2 which is incompatible.
seleniumbase 3.1.0 requires certifi>=2021.10.8, but you have certifi 2021.5.30 which is incompatible.
seleniumbase 3.1.0 requires chardet==4.0.0; python_version >= "3.5", but you have chardet 3.0.4 which is incompatible.
seleniumbase 3.1.0 requires charset-normalizer==2.0.12; python_version >= "3.5", but you have charset-normalizer 2.0.2 which is incompatible.
seleniumbase 3.1.0 requires cryptography==37.0.2; python_version >= "3.7", but you have cryptography 3.3.2 which is incompatible.
seleniumbase 3.1.0 requires h11==0.13.0; python_version >= "3.7", but you have h11 0.12.0 which is incompatible.
seleniumbase 3.1.0 requires idna==3.3; python_version >= "3.6", but you have idna 3.2 which is incompatible.
seleniumbase 3.1.0 requires pdfminer.six==20220319; python_version >= "3.7", but you have pdfminer-six 20191110 which is incompatible.
seleniumbase 3.1.0 requires pyopenssl==22.0.0; python_version >= "3.7", but you have pyopenssl 21.0.0 which is incompatible.
seleniumbase 3.1.0 requires requests==2.27.1; python_version >= "3.6", but you have requests 2.26.0 which is incompatible.
seleniumbase 3.1.0 requires tomli>=2.0.1; python_version >= "3.7", but you have tomli 1.2.3 which is incompatible.
seleniumbase 3.1.0 requires urllib3==1.26.9, but you have urllib3 1.26.6 which is incompatible.
ibm-watson 5.2.2 requires websocket-client==1.1.0, but you have websocket-client 1.3.2 which is incompatible.
htmldate 1.2.1 requires charset-normalizer>=2.0.12, but you have charset-normalizer 2.0.2 which is incompatible.
htmldate 1.2.1 requires python-dateutil>=2.8.2, but you have python-dateutil 2.8.0 which is incompatible.
easyocr 1.4.1 requires Pillow<8.3.0, but you have pillow 9.1.1 which is incompatible.
celery 5.2.6 requires click<9.0,>=8.0.3, but you have click 7.1.2 which is incompatible.
Successfully installed google-api-core-1.31.6 six-1.16.0

Enterキーを押すと、インストールが開始され、「Successfully installed」と表示されます。これが表示されれば、google-cloud-storageが正常にインストールされたことになりますが、今回は「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 の依存性解決は現在インストールされているすべてのパッケージを考慮に入れていません。この挙動は以下のような依存関係の衝突の原因となっています。)」というエラーが出力されました。こちら(https://github.com/googleapis/python-storage)にも記載されていますが、Windowsの場合は、まず仮想環境を構築した上で、インストールすることを推奨します。

コメント

タイトルとURLをコピーしました