JSON format- problem with attribute for class 'TestSuite'

Hello :wave:

So I was trying my hand at this with JSON : Robot Framework User Guide
So at first, I just copied the code provided in the documentation :

from robot.running import TestSuite

# Create suite based on data on the file system.
suite = TestSuite.from_file_system('/path/to/data')

# Get JSON data as a string.
data = suite.to_json()

# Save JSON data to a file with custom indentation.
suite.to_json('data.rbt', indent=2)

Unfortunately I have the following error when I run it : AttributeError: type object 'TestSuite' has no attribute 'from_json'

When I try to do the opposite (meaning creating a suite from JSON), Pycharm automatically underline the TestSuite.from_json with the following warning : Unresolved attribute reference 'from_json' for class 'TestSuite'

I absolutely don’t know why it doesn’t recognize the attributes given it is an exemple from the documentation and I did nothing. I even changed the import, making it import from robot.api, the problem is still the same.
Any guess on where the problem originates from ?

Thank you

Could you check the Robot Framework Version which you are using? (e.g. via pip show robotframework)
As far as I remember, the json serialization is only available from Robot Framework v6

Yes, that was it ! Now I have a all bunch of problems with it, but a least the attribute is recognized. Thank you very much.
Maybe you can help me with my current issue : when I launch it, there is a lot of import ( ex :
File “C:\Users\me\Desktop\robotframework\tests\json.py”, line 1, in
from robot.running import TestSuite )

and it ends with the following error :

ImportError: cannot import name 'Tags' from partially initialized module 'robot.model' (most likely due to a circular import) (C:\Users\me\AppData\Local\Programs\Python\Python311\Lib\site-packages\robot\model\__init__.py)

and I have no idea what a circular import is :upside_down_face: