# Exporting Labels as YOLO Format Causes FileExistsError

**URL:** <https://community.labelstud.io/t/exporting-labels-as-yolo-format-causes-fileexistserror/177>\
**Category:** Label Studio Support\
**Tags:** data-export, yolo\
**Created:** [May 13, 2024, 6:18pm UTC](https://community.labelstud.io/t/exporting-labels-as-yolo-format-causes-fileexistserror/177 "2024-05-13T18:18:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sajarin](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.labelstud.io/sajarin/32/56_2.png) [@sajarin](https://community.labelstud.io/u/sajarin)\
**Post date:** [May 13, 2024, 6:18pm UTC](https://community.labelstud.io/t/exporting-labels-as-yolo-format-causes-fileexistserror/177/1 "2024-05-13T18:18:37Z")

</div>

#### Question:

> I get this error whenever I try and export my labels as yolo format. VOC format works fine.

```auto
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.10/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "/home/ubuntu/.local/lib/python3.10/site-packages/django/utils/decorators.py", line 43, in _wrapper
return bound_method(*args, **kwargs)
File "/home/ubuntu/.local/lib/python3.10/site-packages/label_studio/data_export/api.py", line 183, in get
export_stream, content_type, filename = DataExport.generate_export_file(
File "/home/ubuntu/.local/lib/python3.10/site-packages/label_studio/data_export/models.py", line 161, in generate_export_file
converter.convert(input_json, tmp_dir, output_format, is_dir=False)
File "/home/ubuntu/.local/lib/python3.10/site-packages/label_studio_converter/converter.py", line 176, in convert
self.convert_to_yolo(input_data, output_data, output_image_dir=image_dir,
File "/home/ubuntu/.local/lib/python3.10/site-packages/label_studio_converter/converter.py", line 612, in convert_to_yolo
with open(label_path, 'x'):
FileExistsError: [Errno 17] File exists: '/tmp/tmppeqtunpn/labels/original-33eeb1f72a72190cec2030b773dc6e5206614319.txt'

```

#### Answer:

This error happens when the file already exists in the temporary directory. To resolve it, please do one of the following:

- Clear your `/tmp` directory.
- Ensure that the `/tmp` directory is writable.

Doing so should remove any existing conflicts when attempting to export the labels in YOLO format from Label Studio.
