Skip to content

Couldn't build proto file into descriptor pool #585

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

Closed
shirsakm opened this issue Oct 4, 2024 · 8 comments
Closed

Couldn't build proto file into descriptor pool #585

shirsakm opened this issue Oct 4, 2024 · 8 comments
Assignees
Labels
component:python sdk Issue/PR related to Python SDK status:awaiting user response Awaiting a response from the author status:stale Issue/PR will be closed automatically if there's no further activity type:question Support-related issues

Comments

@shirsakm
Copy link

shirsakm commented Oct 4, 2024

Description of the bug:

I encounter the error "TypeError: Couldn't build proto file into descriptor pool: duplicate symbol "'google.ai.generativelanguage.v1beta.firstlineno'", when trying to import this module.

Actual vs expected behavior:

The module should import correctly and work as in the Quickstart guide.

Any other information you'd like to share?

I am using PyCharm and the module installed is google-generativeai.

@manojssmk manojssmk self-assigned this Oct 7, 2024
@manojssmk manojssmk added component:python sdk Issue/PR related to Python SDK type:question Support-related issues labels Oct 7, 2024
@manojssmk
Copy link

Hi @shirsakm

I tried to reproduce the code in the PyCharm environment, and the basic Quickstart guide is functioning correctly. Would you like to try reinstalling or upgrading the google-generativeai package?

Thanks

@manojssmk manojssmk added the status:awaiting user response Awaiting a response from the author label Oct 7, 2024
@jschanz6
Copy link

jschanz6 commented Oct 8, 2024

I was able to fix the issue by downgrading from Python 3.13 to 3.12.

@cytsai1008
Copy link

Same here, happened on py3.13, not happened in py3.12

Traceback (most recent call last):
<module>
    import google.generativeai
  File ".venv\Lib\site-packages\google\generativeai\__init__.py", line 45, in <module>
    from google.generativeai import caching
  File ".venv\Lib\site-packages\google\generativeai\caching.py", line 21, in <module>
    from google.generativeai import protos
  File ".venv\Lib\site-packages\google\generativeai\protos.py", line 74, in <module>
    from google.ai.generativelanguage_v1beta.types import *
  File ".venv\Lib\site-packages\google\ai\generativelanguage_v1beta\__init__.py", line 21, in <module>
    from .services.cache_service import CacheServiceAsyncClient, CacheServiceClient
  File ".venv\Lib\site-packages\google\ai\generativelanguage_v1beta\services\cache_service\__init__.py", line 16, in <module>
    from .async_client import CacheServiceAsyncClient
  File ".venv\Lib\site-packages\google\ai\generativelanguage_v1beta\services\cache_service\async_client.py", line 50, in <module>
    from google.ai.generativelanguage_v1beta.services.cache_service import pagers
  File ".venv\Lib\site-packages\google\ai\generativelanguage_v1beta\services\cache_service\pagers.py", line 41, in <module>
    from google.ai.generativelanguage_v1beta.types import cache_service, cached_content
  File ".venv\Lib\site-packages\google\ai\generativelanguage_v1beta\types\__init__.py", line 47, in <module>
    from .discuss_service import (
    ...<7 lines>...
    )
  File ".venv\Lib\site-packages\google\ai\generativelanguage_v1beta\types\discuss_service.py", line 22, in <module>
    from google.ai.generativelanguage_v1beta.types import citation, safety
  File ".venv\Lib\site-packages\google\ai\generativelanguage_v1beta\types\safety.py", line 224, in <module>
    class SafetySetting(proto.Message):
    ...<48 lines>...
        )
  File ".venv\Lib\site-packages\proto\message.py", line 279, in __new__
    file_info.generate_file_pb(new_class=cls, fallback_salt=full_name)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv\Lib\site-packages\proto\_file_info.py", line 104, in generate_file_pb
    pool.Add(self.descriptor)
    ~~~~~~~~^^^^^^^^^^^^^^^^^
TypeError: Couldn't build proto file into descriptor pool: duplicate symbol 'google.ai.generativelanguage.v1beta.__firstlineno__'

@shirsakm
Copy link
Author

shirsakm commented Oct 9, 2024

I was able to fix the issue by downgrading from Python 3.13 to 3.12.

Downgrading to 3.12.6 worked for me as well.

@codelion
Copy link

codelion commented Oct 10, 2024

Running into the same issue on python 3.13, downgrading to 3.12 seems to fix the problem for now.

@msukanen
Copy link

And I just got 3.13 installed... Oh well, back to 3.12.7 it is.

Copy link

Marking this issue as stale since it has been open for 14 days with no activity. This issue will be closed if no further activity occurs.

@github-actions github-actions bot added the status:stale Issue/PR will be closed automatically if there's no further activity label Oct 31, 2024
Copy link

This issue was closed because it has been inactive for 28 days. Please post a new issue if you need further assistance. Thanks!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:python sdk Issue/PR related to Python SDK status:awaiting user response Awaiting a response from the author status:stale Issue/PR will be closed automatically if there's no further activity type:question Support-related issues
Projects
None yet
Development

No branches or pull requests

6 participants