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

Fail to run demo: module 'proto' has no attribute 'module' #1636

Open
GilesLuo opened this issue Dec 10, 2024 · 2 comments
Open

Fail to run demo: module 'proto' has no attribute 'module' #1636

GilesLuo opened this issue Dec 10, 2024 · 2 comments

Comments

@GilesLuo
Copy link

Bug description
First, thank you for making this fantastic project! I'm not able to run the demo after installation.

I tried several means to install metagpt but all of them raised the "module 'proto' has no attribute 'module'" error. Is that because I'm using Debian?

$ metagpt "write a cli blackjack game"
2024-12-10 18:01:10.074 | INFO | metagpt.const:get_metagpt_package_root:21 - Package root set to /opt/tiger/MetaGPT
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /opt/tiger/MetaGPT/metagpt/software_company.py:117 in startup │
│ │
│ 114 │ │ typer.echo("Missing argument 'IDEA'. Run 'metagpt --help' for more information." │
│ 115 │ │ raise typer.Exit() │
│ 116 │ │
│ ❱ 117 │ return generate_repo( │
│ 118 │ │ idea, │
│ 119 │ │ investment, │
│ 120 │ │ n_round, │
│ │
│ /opt/tiger/MetaGPT/metagpt/software_company.py:32 in generate_repo │
│ │
│ 29 ) -> ProjectRepo: │
│ 30 │ """Run the startup logic. Can be called from CLI or other Python scripts.""" │
│ 31 │ from metagpt.config2 import config │
│ ❱ 32 │ from metagpt.context import Context │
│ 33 │ from metagpt.roles import ( │
│ 34 │ │ Architect, │
│ 35 │ │ Engineer, │
│ │
│ /opt/tiger/MetaGPT/metagpt/context.py:16 in │
│ │
│ 13 │
│ 14 from metagpt.config2 import Config │
│ 15 from metagpt.configs.llm_config import LLMConfig, LLMType │
│ ❱ 16 from metagpt.provider.base_llm import BaseLLM │
│ 17 from metagpt.provider.llm_provider_registry import create_llm_instance │
│ 18 from metagpt.utils.cost_manager import ( │
│ 19 │ CostManager, │
│ │
│ /opt/tiger/MetaGPT/metagpt/provider/init.py:9 in │
│ │
│ 6 @file : init.py │
│ 7 """ │
│ 8 │
│ ❱ 9 from metagpt.provider.google_gemini_api import GeminiLLM │
│ 10 from metagpt.provider.ollama_api import OllamaLLM │
│ 11 from metagpt.provider.openai_api import OpenAILLM │
│ 12 from metagpt.provider.zhipuai_api import ZhiPuAILLM │
│ │
│ /opt/tiger/MetaGPT/metagpt/provider/google_gemini_api.py:9 in │
│ │
│ 6 from dataclasses import asdict │
│ 7 from typing import List, Optional, Union │
│ 8 │
│ ❱ 9 import google.generativeai as genai │
│ 10 from google.ai import generativelanguage as glm │
│ 11 from google.generativeai.generative_models import GenerativeModel │
│ 12 from google.generativeai.types import content_types │
│ │
│ /mnt/bn/gilesluo000/miniconda3/envs/metagpt/lib/python3.9/site-packages/google/generativeai/in │
│ it
.py:45 in │
│ │
│ 42 │
│ 43 from google.generativeai import version │
│ 44 │
│ ❱ 45 from google.generativeai import types │
│ 46 from google.generativeai.types import GenerationConfig │
│ 47 │
│ 48 │
│ │
│ /mnt/bn/gilesluo000/miniconda3/envs/metagpt/lib/python3.9/site-packages/google/generativeai/type │
│ s/init.py:17 in │
│ │
│ 14 # limitations under the License. │
│ 15 """A collection of type definitions used throughout the library.""" │
│ 16 │
│ ❱ 17 from google.generativeai.types.discuss_types import * │
│ 18 from google.generativeai.types.model_types import * │
│ 19 from google.generativeai.types.text_types import * │
│ 20 from google.generativeai.types.citation_types import * │
│ │
│ /mnt/bn/gilesluo000/miniconda3/envs/metagpt/lib/python3.9/site-packages/google/generativeai/type │
│ s/discuss_types.py:22 in │
│ │
│ 19 from typing import Any, Dict, Union, Iterable, Optional, Tuple, List │
│ 20 from typing_extensions import TypedDict │
│ 21 │
│ ❱ 22 import google.ai.generativelanguage as glm │
│ 23 from google.generativeai import string_utils │
│ 24 │
│ 25 from google.generativeai.types import safety_types │
│ │
│ /mnt/bn/gilesluo000/miniconda3/envs/metagpt/lib/python3.9/site-packages/google/ai/generativelang │
│ uage/init.py:21 in │
│ │
│ 18 version = package_version.version
│ 19 │
│ 20 │
│ ❱ 21 from google.ai.generativelanguage_v1beta.services.discuss_service.async_client import ( │
│ 22 │ DiscussServiceAsyncClient, │
│ 23 ) │
│ 24 from google.ai.generativelanguage_v1beta.services.discuss_service.client import ( │
│ │
│ /mnt/bn/gilesluo000/miniconda3/envs/metagpt/lib/python3.9/site-packages/google/ai/generativelang │
│ uage_v1beta/init.py:21 in │
│ │
│ 18 version = package_version.version
│ 19 │
│ 20 │
│ ❱ 21 from .services.discuss_service import DiscussServiceAsyncClient, DiscussServiceClient │
│ 22 from .services.generative_service import ( │
│ 23 │ GenerativeServiceAsyncClient, │
│ 24 │ GenerativeServiceClient, │
│ │
│ /mnt/bn/gilesluo000/miniconda3/envs/metagpt/lib/python3.9/site-packages/google/ai/generativelang │
│ uage_v1beta/services/discuss_service/init.py:16 in │
│ │
│ 13 # See the License for the specific language governing permissions and │
│ 14 # limitations under the License. │
│ 15 # │
│ ❱ 16 from .async_client import DiscussServiceAsyncClient │
│ 17 from .client import DiscussServiceClient │
│ 18 │
│ 19 all = ( │
│ │
│ /mnt/bn/gilesluo000/miniconda3/envs/metagpt/lib/python3.9/site-packages/google/ai/generativelang │
│ uage_v1beta/services/discuss_service/async_client.py:47 in │
│ │
│ 44 │
│ 45 from google.longrunning import operations_pb2 # type: ignore │
│ 46 │
│ ❱ 47 from google.ai.generativelanguage_v1beta.types import discuss_service, safety │
│ 48 │
│ 49 from .client import DiscussServiceClient │
│ 50 from .transports.base import DEFAULT_CLIENT_INFO, DiscussServiceTransport │
│ │
│ /mnt/bn/gilesluo000/miniconda3/envs/metagpt/lib/python3.9/site-packages/google/ai/generativelang │
│ uage_v1beta/types/init.py:16 in │
│ │
│ 13 # See the License for the specific language governing permissions and │
│ 14 # limitations under the License. │
│ 15 # │
│ ❱ 16 from .citation import CitationMetadata, CitationSource │
│ 17 from .content import ( │
│ 18 │ Blob, │
│ 19 │ Content, │
│ │
│ /mnt/bn/gilesluo000/miniconda3/envs/metagpt/lib/python3.9/site-packages/google/ai/generativelang │
│ uage_v1beta/types/citation.py:22 in │
│ │
│ 19 │
│ 20 import proto # type: ignore │
│ 21 │
│ ❱ 22 protobuf = proto.module( │
│ 23 │ package="google.ai.generativelanguage.v1beta", │
│ 24 │ manifest={ │
│ 25 │ │ "CitationMetadata", │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: module 'proto' has no attribute 'module'

Environment information

  • LLM type and model name:
  • System version:Debian GNU/Linux 12 (bookworm)
  • Python version:3.9.30
  • MetaGPT version or branch: v0.8.1
@shenchucheng
Copy link
Collaborator

Which version of protobuf is being used?

@iorisa
Copy link
Collaborator

iorisa commented Jan 2, 2025

Which version of google-generativeai is being used?
I'm using 0.4.1

pip show google-generativeai
Name: google-generativeai
Version: 0.4.1
Summary: Google Generative AI High level API client library and tools.
Home-page: https://github.com/google/generative-ai-python
Author: Google LLC
Author-email: [email protected]
License: Apache 2.0
Location: /Users/ix/github/bak/MetaGPT-env/lib/python3.9/site-packages
Requires: google-ai-generativelanguage, google-api-core, google-auth, protobuf, pydantic, tqdm, typing-extensions
Required-by: llama-index-embeddings-gemini, metagpt

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

3 participants