python - 如何解决“ImportError:没有名为 google.auth 的模块”?
问题描述
我在本地通过 dev_appserver 运行标准应用引擎环境,无法摆脱以下错误:
ImportError:没有名为 google.auth 的模块
完整追溯(用 替换个人详细信息...
):
Traceback (most recent call last):
File "/Users/.../google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/Users/.../google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "/Users/.../google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 85, in LoadObject
obj = __import__(path[0])
File "/Users/.../.../main.py", line 6, in <module>
from services.get_campaigns import get_campaigns
File "/Users/.../.../get_campaigns.py", line 3, in <module>
from googleads import adwords
File "/Users/.../.../lib/googleads/__init__.py", line 17, in <module>
from ad_manager import AdManagerClient
File "/Users/.../lib/googleads/ad_manager.py", line 28, in <module>
import googleads.common
File "/Users/.../lib/googleads/common.py", line 51, in <module>
import googleads.oauth2
File "/Users/.../lib/googleads/oauth2.py", line 28, in <module>
import google.auth.transport.requests
File "/Users/.../google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/runtime/sandbox.py", line 1154, in load_module
raise ImportError('No module named %s' % fullname)
ImportError: No module named google.auth
我确实安装了 google.auth,如下pip show google.auth
所示:
Name: google-auth
Version: 1.6.3
Summary: Google Authentication Library
Home-page: https://github.com/GoogleCloudPlatform/google-auth-library-python
Author: Google Cloud Platform
Author-email: jonwayne+google-auth@google.com
License: Apache 2.0
Location: /Users/.../Library/Python/2.7/lib/python/site-packages
Requires: rsa, pyasn1-modules, cachetools, six
Required-by: googleads, google-auth-oauthlib, google-auth-httplib2, google-api-python-client
我已经升级了所有需要 google.auth 的模块 - googleads、google-auth-oauthlib、google-auth-httplib2、google-api-python-client - 但没有结果。
我不太确定接下来要采取什么措施来调试此问题。这里的任何人都可以指出我正确的方向吗?
解决方案
推荐阅读
- python - sqlite3.OperationalError:没有这样的表:my_boardgames 但它在那里
- bash - 每多个分隔符拆分一个字符串
- react-native - 使用 API 级别 28 反应原生 Android
- matlab - 为什么在 Matlab 中使用 ifft2 时图像会移位
- apache-spark - Spark将写入操作流式传输到couchbase?
- javascript - 为现代原语扩展对象包装器
- whitespace - Apache Tika 奇怪的空白符号
- python - 如何用文件中的另一个字符串替换条目中的字符串-Python-Tkinter
- java - 为什么每当我在父类 - Android 中触发操作时,我的子类方法总是被调用?
- php - Laravel 中的多对多关系错误:此路由不支持 POST 方法。支持的方法:GET、HEAD