Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

google.auth.exceptions.DefaultCredentialsError的问题 #19

Open
lopezycj opened this issue Feb 4, 2024 · 6 comments
Open

google.auth.exceptions.DefaultCredentialsError的问题 #19

lopezycj opened this issue Feb 4, 2024 · 6 comments

Comments

@lopezycj
Copy link

lopezycj commented Feb 4, 2024

Traceback (most recent call last):
File "F:\my\tg_bot_collections2\handlers_init_.py", line 53, in wrapper
return handler(message, *args, **kwargs)
File "F:\my\tg_bot_collections2\handlers\gemini.py", line 167, in gemini_handler
player.send_message(m)
File "F:\my\tg_bot_collections2.venv\lib\site-packages\google\generativeai\generative_models.py", line 367, in send_message
response = self.model.generate_content(
File "F:\my\tg_bot_collections2.venv\lib\site-packages\google\generativeai\generative_models.py", line 241, in generate_content
self._client = client.get_default_generative_client()
File "F:\my\tg_bot_collections2.venv\lib\site-packages\google\generativeai\client.py", line 230, in get_default_generative_client
return _client_manager.get_default_client("generative")
File "F:\my\tg_bot_collections2.venv\lib\site-packages\google\generativeai\client.py", line 161, in get_default_client
client = self.make_client(name)
File "F:\my\tg_bot_collections2.venv\lib\site-packages\google\generativeai\client.py", line 121, in make_client
client = cls(**self.client_config)
File "F:\my\tg_bot_collections2.venv\lib\site-packages\google\ai\generativelanguage_v1beta\services\generative_service\client.py", line 433, in init
self._transport = Transport(
File "F:\my\tg_bot_collections2.venv\lib\site-packages\google\ai\generativelanguage_v1beta\services\generative_service\transports\grpc.py", line 150, in init
super().init(
File "F:\my\tg_bot_collections2.venv\lib\site-packages\google\ai\generativelanguage_v1beta\services\generative_service\transports\base.py", line 98, in init
credentials, _ = google.auth.default(
File "F:\my\tg_bot_collections2.venv\lib\site-packages\google\auth_default.py", line 691, in default
raise exceptions.DefaultCredentialsError(_CLOUD_SDK_MISSING_CREDENTIALS)
google.auth.exceptions.DefaultCredentialsError: Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information.

@yihong0618
Copy link
Owner

首先确定你的 terminal 能用 gemini 香港的梯子不行的,得用美国或者日本的

@lopezycj
Copy link
Author

lopezycj commented Feb 5, 2024

我是用美国的VPS

@lopezycj
Copy link
Author

lopezycj commented Feb 6, 2024

我用这个例子就可以正常用gemini的https://github.com/abersheeran/telegram-bot

@yihong0618
Copy link
Owner

@lopezycj 感谢我确认下

@yihong0618
Copy link
Owner

pip install google-generativeai==0.3.1

@lopezycj
Copy link
Author

还是不行,一样的错误,我这个破VPS,安装gcloud都没成功过。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants