Getting Error While Google Cloud CLI installation - No module named 'oauthlib.oauth2
Asked Answered
E

1

7

I'm trying to install Google Cloud CLI in my MacBook pro (M1). I have downloaded the M1 version of gCLI SDK for installation.

A bit about my environment:

  • python version 3.9.5 (environment managed by pyenv)
  • currently installed oauthlib version oauthlib==3.2.2

Here's the error I'm getting:

ModuleNotFoundError: No module named 'oauthlib.oauth2' during gCLI Installation

I've also tried installing python-oauth2 to resolve the problem, but no luck. Any pointers will be highly appreciated. Thanks!

Eveleen answered 21/11, 2022 at 21:21 Comment(3)
Couldn't solve this problem, but finally figured out a way to install google-cloud-sdk in Mac following these steps: -Enter the following at a command prompt: curl https://sdk.cloud.google.com | bash -Restart your shell: exec -l $SHELL -Run gcloud init to initialize the gcloud environment: gcloud init Thanks to this thread for solving the installation problem #63587350Eveleen
It is still the same error and your solution from the comment worked out for me. ThanksMagnesium
@Magnesium Great for sharing the feedback. I've added the comment as an answer. Could you upvote the answer pls?Eveleen
E
5

Here's a workaround to install google-cloud-sdk in Mac to avoid the errors in the post:

  • Enter the following at a command prompt: curl https://sdk.cloud.google.com | bash
  • Restart your shell: exec -l $SHELL
  • Run gcloud init to initialize the gcloud environment
Eveleen answered 16/4 at 13:25 Comment(1)
Worked well even after 8 years! Thanks for sharing.Fancier

© 2022 - 2024 — McMap. All rights reserved.