Coder Social home page Coder Social logo

Comments (10)

clundin25 avatar clundin25 commented on August 11, 2024 1

I believe test.py should work after you add import google.oauth2.

from google-auth-library-python.

parthea avatar parthea commented on August 11, 2024

Can you please share the output after running which python?

Please also try running python -m pip install google-auth.

Please also check if the path that you see after running which python appears in in the output of this command

import sys
sys.path

from google-auth-library-python.

CureSaba avatar CureSaba commented on August 11, 2024

image
which python gives an error

from google-auth-library-python.

parthea avatar parthea commented on August 11, 2024

Sorry about that. where python may work , as which python is for unix.

Please also try running

python -c "import os, sys; print(os.path.dirname(sys.executable))"

Also try:

python -m pip install google-auth --ignore-installed

from google-auth-library-python.

CureSaba avatar CureSaba commented on August 11, 2024

image

from google-auth-library-python.

parthea avatar parthea commented on August 11, 2024

@clundin25 Do you have availability to reproduce the issue in Windows Power Shell?

from google-auth-library-python.

clundin25 avatar clundin25 commented on August 11, 2024

I was not able to reproduce.

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\clundin> python --version
Python 3.12.0
PS C:\Users\clundin> python -m pip install google-auth
Collecting google-auth
  Downloading google_auth-2.24.0-py2.py3-none-any.whl.metadata (4.7 kB)
Collecting cachetools<6.0,>=2.0.0 (from google-auth)
  Obtaining dependency information for cachetools<6.0,>=2.0.0 from https://files.pythonhosted.org/packages/a2/91/2d843adb9fbd911e0da45fbf6f18ca89d07a087c3daa23e955584f90ebf4/cachetools-5.3.2-py3-none-any.whl.metadata
  Downloading cachetools-5.3.2-py3-none-any.whl.metadata (5.2 kB)
Collecting pyasn1-modules>=0.2.1 (from google-auth)
  Downloading pyasn1_modules-0.3.0-py2.py3-none-any.whl (181 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 181.3/181.3 kB 2.7 MB/s eta 0:00:00
Collecting rsa<5,>=3.1.4 (from google-auth)
  Downloading rsa-4.9-py3-none-any.whl (34 kB)
Collecting pyasn1<0.6.0,>=0.4.6 (from pyasn1-modules>=0.2.1->google-auth)
  Obtaining dependency information for pyasn1<0.6.0,>=0.4.6 from https://files.pythonhosted.org/packages/d1/75/4686d2872bf2fc0b37917cbc8bbf0dd3a5cdb0990799be1b9cbf1e1eb733/pyasn1-0.5.1-py2.py3-none-any.whl.metadata
  Downloading pyasn1-0.5.1-py2.py3-none-any.whl.metadata (8.6 kB)
Downloading google_auth-2.24.0-py2.py3-none-any.whl (183 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 183.8/183.8 kB 10.8 MB/s eta 0:00:00
Downloading cachetools-5.3.2-py3-none-any.whl (9.3 kB)
Downloading pyasn1-0.5.1-py2.py3-none-any.whl (84 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 84.9/84.9 kB 5.0 MB/s eta 0:00:00
Installing collected packages: pyasn1, cachetools, rsa, pyasn1-modules, google-auth
Successfully installed cachetools-5.3.2 google-auth-2.24.0 pyasn1-0.5.1 pyasn1-modules-0.3.0 rsa-4.9

[notice] A new release of pip is available: 23.2.1 -> 23.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip
PS C:\Users\clundin> python -c 'import google.auth'
PS C:\Users\clundin> python -c 'import google.oauth2'
PS C:\Users\clundin>

from google-auth-library-python.

CureSaba avatar CureSaba commented on August 11, 2024

image
It works but why?
I think import google will load all package

from google-auth-library-python.

clundin25 avatar clundin25 commented on August 11, 2024

Here is a document outlining importing for Python 3.12. https://docs.python.org/3/reference/import.html.

I think the behavior is likely because google is a namespace package, but I did not take a close look.

from google-auth-library-python.

CureSaba avatar CureSaba commented on August 11, 2024

Thank you for support

from google-auth-library-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.