Err22 for COCO/YOLO export

Hi team !
Thank you very much for this new support community and for your dedication to help us.

I am reaching out to you again because I have been meeting an “Err22 : Invalid argument” when I try to export my annotations in COCO and YOLO format.

Here are the details of my current set up :

  • I installed LabelStudio with pip. I currently use the Label Studio 1.12 version in a Python 3.12 venv.
  • I set up a local server to upload my files, following your tutorials.
  • I annotated 800 images with Bounding Boxes. Some of the images have no annotations / rotated boxes.
  • I am using macOS Sonoma 14.2.1

Here are the details of my issue :

  • At first, I was working on Label Studio 1.8 with Python 3.7 to annotate my corpus. I had tried around march 2024 to test my work and exported my files in JSON and COCO : everything worked then.
  • I finished my annotations last week and updated to Label Studio 1.12 with Python 3.12 in a venv.
  • The export in JSON is currently working.
  • BUT here is the Err 22 for COCO/YOLO :
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/wsgiref/", line 138, in run
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/wsgiref/", line 184, in finish_response
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/wsgiref/", line 293, in write
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/wsgiref/", line 467, in _write
    result = self.stdout.write(data)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/", line 826, in write
OSError: [Errno 22] Invalid argument

Trying to fix this, I have tried to use LabelStudio 1.12 with Python 3.8, 3.9, 3.10 and 3.11 venv. I always get this same error.

What should I try to do ?
Should I just try to write my own conversion script as you mentioned in an other issue ?

Thank you very much again,


hey @alicetruc, thanks for posting here, sorry that the previous suggestions in Slack have not been helpful.

It seems like this is either a case of a regression with the code or something unique to your files/setup that is causing this error. At the moment, the error and stack trace are a bit non-descript so I’m not able to tell.

Can I ask you to enable debug logging in Label Studio to get more detailed output which might help in pinpointing the issue.

Alternatively, I can help provide a basic generated conversion script that might help in getting your data exported. One final option would be to downgrade to version 1.8 while our team works on trying to reproduce the issue. The latter obviously isn’t ideal but it may be the most direct way of getting you unblocked with your project at the moment.