quickstart.py credentials.json not found for read

Abierto
#211 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
30/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python

Línea de trabajo

The failure comes from the InstalledAppFlow.from_client_secrets_file call in main() of gmail/quickstart/quickstart.py, which opens credentials.json relative to the current working directory. Reproduce by running the script from a different directory than the one holding the file, then decide whether the sample should resolve the path against the script's location or report a clearer error. Done means the script either finds the credentials file or fails with an actionable message, and the README or quickstart text says where the file must go.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Expected Behavior

As described in https://developers.google.com/gmail/api/quickstart/python

Actual Behavior

File "/hd2/projects/temp/python-samples/gmail/quickstart/quickstart.py", line 62, in
main()
File "/hd2/projects/temp/python-samples/gmail/quickstart/quickstart.py", line 41, in main
flow = InstalledAppFlow.from_client_secrets_file(
File "/home/stephen/.local/lib/python3.9/site-packages/google_auth_oauthlib/flow.py", line 180, in from_client_secrets_file
with open(client_secrets_file, 'r') as json_file:
FileNotFoundError: [Errno 2] No such file or directory: 'credentials.json'

Steps to Reproduce the Problem

1.Download these python samples

  1. install requirements through requirements.txt
  2. run the script

Specifications

  • Python version (python --version)
  • 3.9.6
  • OS (Mac/Linux/Windows)
  • Arch rolling[5.10.48-1-lts]
Lenguaje dominante
Python
Estrellas
1.4k
Forks
917
Merge medio
3 min
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de googleworkspace/python-samples

Todos los issues de googleworkspace/python-samples

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.