با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
این صفحه برخی از مشکلات رایجی را که ممکن است در مورد احراز هویت و مجوز با آنها مواجه شوید، توضیح می دهد.
This app isn't verified
اگر صفحه رضایت OAuth اخطار «این برنامه تأیید نشده است» را نشان میدهد، برنامه شما دامنههایی را درخواست میکند که دسترسی به دادههای حساس کاربر را فراهم میکند. اگر برنامه شما از دامنه های حساس استفاده می کند، برنامه شما باید مراحل تأیید را طی کند تا آن هشدار و سایر محدودیت ها حذف شود. در مرحله توسعه، میتوانید با انتخاب Advanced > Go to {Project Name} (ناامن) از این هشدار عبور کنید.
File not found error for credentials.json
هنگام اجرای نمونه کد، ممکن است پیام خطای "فایل یافت نشد" یا "هیچ فایلی وجود ندارد" را در رابطه با credentials.json دریافت کنید.
این خطا زمانی رخ می دهد که شما اعتبار برنامه دسکتاپ را مجاز نکرده باشید. برای یادگیری نحوه ایجاد اعتبارنامه برای یک برنامه دسکتاپ، به Create credentials بروید.
پس از ایجاد اعتبارنامه، مطمئن شوید که فایل JSON دانلود شده به عنوان credentials.json ذخیره شده است. سپس فایل را به پوشه کاری خود منتقل کنید.
Token has been expired or revoked
هنگام اجرای نمونه کد، ممکن است پیغام خطای "Token is expired" یا "Token has been revokuar" دریافت کنید.
این خطا زمانی رخ می دهد که یک نشانه دسترسی از سرور مجوز Google منقضی شده باشد یا باطل شده باشد. برای اطلاعات در مورد علل و راهحلهای احتمالی، به انقضای نشانه Refresh مراجعه کنید.
خطاهای پایتون
در زیر برخی از خطاهای رایج پایتون آورده شده است.
AttributeError: 'Module_six_moves_urllib_parse' object has no attribute 'urlparse'
این خطا می تواند در Mac OSX رخ دهد که در آن نصب پیش فرض six ماژول (وابستگی کتابخانه پایتون) قبل از نصبی که پیپ نصب شده بارگذاری می شود. برای رفع مشکل، محل نصب پیپ را به متغیر محیطی سیستم PYTHONPATH اضافه کنید:
محل نصب پیپ را تعیین کنید:
pip show six | grep "Location:" | cut -d " " -f2
این مکان را یادداشت کنید زیرا برای مرحله بعدی لازم است.
خط زیر را به فایل ~/.bashrc خود اضافه کنید و INSTALL_PATH با مکان تعیین شده در مرحله قبل جایگزین کنید:
export PYTHONPATH=$PYTHONPATH:INSTALL_PATH
فایل ~/.bashrc خود را دوباره بارگیری کنید:
source ~/.bashrc
TypeError: sequence item 0: expected str instance, bytes found
این خطا به دلیل یک اشکال در httplib2 است. برای حل این مشکل، به آخرین نسخه httplib2 ارتقا دهید:
pip install --upgrade httplib2
Cannot uninstall 'six'
هنگام اجرای دستور pip install ، ممکن است خطای زیر را دریافت کنید:
Cannot uninstall 'six'. It is a distutils installed project and thus we
cannot accurately determine which files belong to it which would lead to
only a partial uninstall.
این خطا در Mac OSX زمانی رخ می دهد که پیپ سعی می کند بسته six از پیش نصب شده را ارتقا دهد. برای حل این مشکل، پرچم --ignore-installed six به دستور pip install اضافه کنید.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Troubleshoot authentication and authorization issues\n\nThis page describes some common issues that you might encounter involving\nauthentication and authorization.\n\n`This app isn't verified`\n-------------------------\n\nIf the OAuth consent screen displays the warning \"This app isn't verified,\" your\napp is requesting scopes that provide access to sensitive user data. If your\napplication uses sensitive scopes, your app must go through the\n[verification process](https://support.google.com/cloud/answer/7454865)\nto remove that warning and other limitations. During the development phase, you\ncan continue past this warning by selecting **Advanced \\\u003e Go to {Project Name}\n(unsafe)**.\n\n`File not found error for credentials.json`\n-------------------------------------------\n\nWhen running the code sample, you might receive a \"file not found\" or \"no such\nfile\" error message regarding credentials.json.\n\nThis error occurs when you have not authorized the desktop application\ncredentials. To learn how to create credentials\nfor a desktop application, go to\n[Create credentials](/workspace/guides/create-credentials#desktop-app).\n\nAfter you create the credentials, make sure the downloaded JSON file is saved as\n`credentials.json`. Then move the file to your working directory.\n\n`Token has been expired or revoked`\n-----------------------------------\n\nWhen running the code sample, you might receive a \"Token has been expired\" or\n\"Token has been revoked\" error message.\n\nThis error occurs when an access token from the Google Authorization Server has\neither expired or has been revoked. For information about potential causes\nand fixes, see\n[Refresh token expiration](/identity/protocols/oauth2#expiration).\n\nPython errors\n-------------\n\nThe following are some common Python errors.\n\n### `AttributeError: 'Module_six_moves_urllib_parse' object has no attribute 'urlparse'`\n\nThis error can occur in Mac OSX where the default installation of the `six`\nmodule (a dependency of the Python library) is loaded before the one that pip\ninstalled. To fix the issue, add pip's install location to the `PYTHONPATH`\nsystem environment variable:\n\n1. Determine pip's install location:\n\n ```\n pip show six | grep \"Location:\" | cut -d \" \" -f2\n ```\n\n Make a note of this location because it's needed for the next step.\n2. Add the following line to your `~/.bashrc` file, replacing\n \u003cvar translate=\"no\"\u003eINSTALL_PATH\u003c/var\u003e with the location determined from the\n previous step:\n\n ```\n export PYTHONPATH=$PYTHONPATH:INSTALL_PATH\n ```\n3. Reload your `~/.bashrc` file:\n\n ```\n source ~/.bashrc\n ```\n\n### `TypeError: sequence item 0: expected str instance, bytes found`\n\nThis error is due to a bug in `httplib2`. To resolve this problem, upgrade\nto the latest version of `httplib2`: \n\n pip install --upgrade httplib2\n\n### `Cannot uninstall 'six'`\n\nWhen running the `pip install` command, you might receive the following error: \n\n```\nCannot uninstall 'six'. It is a distutils installed project and thus we\ncannot accurately determine which files belong to it which would lead to\nonly a partial uninstall.\n```\n\nThis error occurs on Mac OSX when pip attempts to upgrade the pre-installed\n`six` package. To work around this issue, add the flag\n`--ignore-installed six` to the `pip install` command."]]