# KeyError: local path windows

**URL:** <https://community.shotgridsoftware.com/t/keyerror-local-path-windows/17514>\
**Category:** Pipeline Integrations\
**Created:** [June 16, 2023, 10:09am UTC](https://community.shotgridsoftware.com/t/keyerror-local-path-windows/17514 "2023-06-16T10:09:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgari](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/sgari/32/5531_2.png) [@sgari](https://community.shotgridsoftware.com/u/sgari)\
**Post date:** [June 16, 2023, 10:09am UTC](https://community.shotgridsoftware.com/t/keyerror-local-path-windows/17514/1 "2023-06-16T10:09:40Z")

</div>

Hello All,

I’m trying to run my publish through Shotgrid but I’m getting the following error in publish.py file

p, li { white-space: pre-wrap; }

sp\_script\_path = tk.shotgun.find\_one(‘PublishedFile’,

KeyError: ‘local\_path\_windows’

Does anyone know how to fix this? It’s happening in my publish.py

---

<div class="post-metadata">

**Author:** ![Patrick](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/patrick/32/4767_2.png) [@Patrick](https://community.shotgridsoftware.com/u/Patrick)\
**Post date:** [June 16, 2023, 11:04am UTC](https://community.shotgridsoftware.com/t/keyerror-local-path-windows/17514/2 "2023-06-16T11:04:44Z")

</div>

I think you’re post has broken formatting and missing info.  
Did you get the “path” attribute first before getting “local\_path\_windows”  
Please repost your code.

---

<div class="post-metadata">

**Author:** ![sgari](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/sgari/32/5531_2.png) [@sgari](https://community.shotgridsoftware.com/u/sgari)\
**Post date:** [June 16, 2023, 11:57am UTC](https://community.shotgridsoftware.com/t/keyerror-local-path-windows/17514/3 "2023-06-16T11:57:46Z")

</div>

Hi Patrick,

Thanks for the response. Here is the issue.

Traceback (most recent call last):  
File “C:\Program Files\Shotgun\Resources\Desktop\Python\bundle\_cache\app\_store\tk-multi-publish2\v2.6.4\python\tk\_multi\_publish2\api\plugins\publish\_plugin\_instance.py”, line 308, in \_handle\_plugin\_error  
yield  
File “C:\Program Files\Shotgun\Resources\Desktop\Python\bundle\_cache\app\_store\tk-multi-publish2\v2.6.4\python\tk\_multi\_publish2\api\plugins\publish\_plugin\_instance.py”, line 204, in run\_publish  
self.\_hook\_instance.publish(settings, item)  
File “C:\Users\sreyeeshgarimella\Documents\LAM\_pipeline\_config\_1.0.6\hooks\tk-multi-publish2\standalone\publish\_file.py”, line 164, in publish  
sp\_script\_path = tk.shotgun.find\_one(‘PublishedFile’,  
KeyError: ‘local\_path\_windows’

The publisher tool seems to be cutting that off. I’ve checked the code and it seems to be fine . I have a process that scene preps after effects files automatically. The validate goes through fine. It can’t seem to publish and fails on the publish.

---

<div class="post-metadata">

**Author:** ![Patrick](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/patrick/32/4767_2.png) [@Patrick](https://community.shotgridsoftware.com/u/Patrick)\
**Post date:** [August 1, 2023, 2:40pm UTC](https://community.shotgridsoftware.com/t/keyerror-local-path-windows/17514/4 "2023-08-01T14:40:03Z")

</div>

> [@sgari](#):
>
> sp\_script\_path = tk.shotgun.find\_one(‘PublishedFile’,  
> KeyError: ‘local\_path\_windows’

I’d need to see the full lines around this snippet.  
What variable are you trying to get local\_path\_windows from, and can you log the value of that variable before the error happens so we can see what the publishedFile dict looks like?
