تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
توضّح هذه الصفحة بعض المشاكل الشائعة التي قد تواجهك بشأن المصادقة والتفويض.
This app isn't verified
إذا عرضت شاشة موافقة OAuth التحذير "لم يتم التحقّق من هذا التطبيق"، يعني ذلك أنّ تطبيقك يطلب نطاقات تتيح الوصول إلى بيانات المستخدمين الحسّاسة. إذا كان تطبيقك يستخدم نطاقات حسّاسة، يجب أن يخضع
لعملية التحقّق
لإزالة هذا التحذير والقيود الأخرى. أثناء مرحلة التطوير، يمكنك تجاوز هذا التحذير من خلال النقر على خيارات متقدمة > الانتقال إلى {اسم المشروع} (غير آمن).
File not found error for credentials.json
عند تشغيل نموذج الرمز، قد تظهر لك رسالة الخطأ "لم يتم العثور على الملف" أو "لا يوجد ملف بهذا الاسم" بشأن ملف credentials.json.
يحدث هذا الخطأ عندما لا تكون قد منحت الإذن ببيانات اعتماد تطبيق سطح المكتب. للتعرّف على كيفية إنشاء بيانات اعتماد لتطبيق على الكمبيوتر، انتقِل إلى إنشاء بيانات اعتماد.
بعد إنشاء بيانات الاعتماد، تأكَّد من حفظ ملف JSON الذي تم تنزيله باسم
credentials.json. بعد ذلك، انقل الملف إلى دليل العمل.
Token has been expired or revoked
عند تشغيل نموذج الرمز، قد تظهر لك رسالة الخطأ "انتهت صلاحية الرمز المميّز" أو "تم إبطال الرمز المميّز".
يحدث هذا الخطأ عندما تنتهي صلاحية رمز الدخول من خادم التفويض في Google أو يتم إبطاله. للحصول على معلومات حول الأسباب المحتملة والحلول، يُرجى الاطّلاع على انتهاء صلاحية الرمز المميّز لإعادة التحميل.
أخطاء Python
في ما يلي بعض أخطاء Python الشائعة.
AttributeError: 'Module_six_moves_urllib_parse' object has no attribute 'urlparse'
يمكن أن يحدث هذا الخطأ في نظام التشغيل Mac OSX عندما يتم تحميل عملية التثبيت التلقائية للوحدة six (وهي إحدى التبعيات لمكتبة Python) قبل عملية التثبيت التي أجراها pip. لإصلاح المشكلة، أضِف موقع تثبيت pip إلى PYTHONPATH
متغيّر بيئة النظام:
تحديد موقع تثبيت pip:
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 عندما تحاول أداة pip ترقية الحزمة المثبَّتة مسبقًا.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."]]