Closed shirsakm closed 1 week ago
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
I was able to fix the issue by downgrading from Python 3.13 to 3.12.
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__'
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.
Running into the same issue on python 3.13, downgrading to 3.12 seems to fix the problem for now.
And I just got 3.13 installed... Oh well, back to 3.12.7 it is.
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.
This issue was closed because it has been inactive for 28 days. Please post a new issue if you need further assistance. Thanks!
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
.