# KeyError: 'dir'

**URL:** <https://opentps.discourse.group/t/keyerror-dir/83>\
**Category:** General\
**Created:** [July 11, 2025, 8:25pm UTC](https://opentps.discourse.group/t/keyerror-dir/83 "2025-07-11T20:25:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stevie](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@Stevie](https://opentps.discourse.group/u/Stevie)\
**Post date:** [July 11, 2025, 8:25pm UTC](https://opentps.discourse.group/t/keyerror-dir/83/1 "2025-07-11T20:25:41Z")

</div>

Hello! I’m trying to build a python program that uses OpenTPS but I’m running into this issue:  
File “main.py”, line 8, in   
File “”, line 1176, in \_find\_and\_load  
File “”, line 1147, in \_find\_and\_load\_unlocked  
File “”, line 690, in _load\_unlocked  
File “PyInstaller\loader\pyimod02\_importers.py”, line 457, in exec\_module  
File "opentps\core\_init_.py", line 4, in   
File “opentps\core\_loggingConfig.py”, line 15, in **init**  
File “opentps\core\utils\programSettings.py”, line 70, in workspace  
File “configparser.py”, line 979, in **getitem**  
KeyError: ‘dir’

Has anyone encountered this before? ChatGPT says its missing config file but I haven’t been able to figure out how to fix it yet

---

<div class="post-metadata">

**Author:** ![Stevie](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@Stevie](https://opentps.discourse.group/u/Stevie)\
**Post date:** [July 11, 2025, 8:26pm UTC](https://opentps.discourse.group/t/keyerror-dir/83/2 "2025-07-11T20:26:26Z")

</div>

I should clarify, I’m able to build the program, but main.exe wont run after it’s build, this is the error output. It runs fine in VS Code

---

<div class="post-metadata">

**Author:** ![Romain\_Schyns](https://yyz2.discourse-cdn.com/free1/user_avatar/opentps.discourse.group/romain_schyns/32/64_2.png) [@Romain\_Schyns](https://opentps.discourse.group/u/Romain_Schyns)\
**Post date:** [July 14, 2025, 12:03pm UTC](https://opentps.discourse.group/t/keyerror-dir/83/3 "2025-07-14T12:03:50Z")

</div>

Hello Stevie,

Unfortunately, we haven’t attempted to build a program using OpenTPS.

However, based on your description, the issue may be related to the OpenTPS workspace or to the configuration file used to generate it (see [this file](https://gitlab.com/openmcsquare/opentps/-/blob/master/opentps_core/opentps/core/config/config_template.cfg?ref_type=heads)).

You could try deleting the workspace before launching your program to see if it is regenerated correctly.

If that doesn’t resolve the problem, please share more details about your program and how you’re compiling it. We’ll do our best to assist you.

And of course, don’t hesitate to let us know if you manage to find a solution.

Romain Schyns  
OpenTPS team

---

<div class="post-metadata">

**Author:** ![Stevie](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@Stevie](https://opentps.discourse.group/u/Stevie)\
**Post date:** [July 15, 2025, 7:51pm UTC](https://opentps.discourse.group/t/keyerror-dir/83/4 "2025-07-15T19:51:50Z")

</div>

Where should my workspace be? I’m not sure where on my computer the program is grabbing the opentps files from

---

<div class="post-metadata">

**Author:** ![Romain\_Schyns](https://yyz2.discourse-cdn.com/free1/user_avatar/opentps.discourse.group/romain_schyns/32/64_2.png) [@Romain\_Schyns](https://opentps.discourse.group/u/Romain_Schyns)\
**Post date:** [July 16, 2025, 9:09am UTC](https://opentps.discourse.group/t/keyerror-dir/83/5 "2025-07-16T09:09:19Z")

</div>

The workspace should be located in your user folder and is named **`openTPS_workspace`**.

Did you install OpenTPS from our GitLab repository or via `pip install`?

---

<div class="post-metadata">

**Author:** ![Stevie](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@Stevie](https://opentps.discourse.group/u/Stevie)\
**Post date:** [July 16, 2025, 5:41pm UTC](https://opentps.discourse.group/t/keyerror-dir/83/6 "2025-07-16T17:41:20Z")

</div>

Oh I see, I installed using pip
