google-deepmind / concordia

A library for generative social simulation
Apache License 2.0
497 stars 96 forks source link

Error Occurring in Python 3.10 #25

Closed paehal closed 7 months ago

paehal commented 7 months ago

Recent updates have led to an error. Below is the error message:

ImportError                               Traceback (most recent call last)
[<ipython-input-7-30cc0d525de9>](https://localhost:8080/#) in <cell line: 11>()
      9 from IPython import display
     10 
---> 11 from concordia.agents import basic_agent
     12 from concordia import components as generic_components
     13 from concordia.components import agent as agent_components

1 frames
[/usr/local/lib/python3.10/dist-packages/concordia/typing/component.py](https://localhost:8080/#) in <module>
     17 
     18 import abc
---> 19 from typing import Self, Sequence
     20 
     21 

ImportError: cannot import name 'Self' from 'typing' (/usr/lib/python3.10/typing.py)
jzleibo commented 7 months ago

it should work with Python 3.11. Or if you want to use 3.10 then you can just remove the keyword "Self" in that file. It is only for type hinting and so should have no effect if you just remove it. I'll defer to @jagapiou on whether we will ultimately restore support for 3.10 or not.

jagapiou commented 6 months ago

We now use 3.11 internally so concordia will have to be >=3.11.

jagapiou commented 6 months ago

Updated in v1.2.0