# Worker\_dir location referenced in environment variables

**URL:** https://discuss.ray.io/t/worker-dir-location-referenced-in-environment-variables/22016
**Category:** Ray Core
**Created:** [March 11, 2025, 2:35am UTC](https://discuss.ray.io/t/worker-dir-location-referenced-in-environment-variables/22016 "2025-03-11T02:35:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![christhorn2](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@christhorn2](https://discuss.ray.io/u/christhorn2)
#### Post date: [March 11, 2025, 2:35am UTC](https://discuss.ray.io/t/worker-dir-location-referenced-in-environment-variables/22016/1 "2025-03-11T02:35:15Z")

</div>

I am using ray.init() with worker\_dir specified in the runtime\_env, in order to transport some code from local to the workers.

Part of the code relies upon on environment variable being set, locating where the code I have transported is. It is functionally the similar as PYTHONPATH, and I see that PYTHONPATH is set to the working\_dir. I would like to set “OTHERPATH” to be working\_dir/src.

I have tried using PYTHONPATH (which gets replaced with “”) and using RAY\_RUNTIME\_ENV\_CREATE\_WORKING\_DIR which didn’t work either.

Any ideas?

**1. Severity of the issue: (select one)**  
Medium: Significantly affects my productivity but can find a workaround.

**2. Environment:**

- Ray version: 2.43
- Python version: 3.11
- OS: RH 8.8
- Cloud/Infrastructure: AWS Kube
- Other libs/tools (if relevant):

**3. What happened vs. what you expected:**

- Expected: I wanted to set an environment variable which references the location of working\_dir
- Actual: I wasn’t able to.

---

<div class="post-metadata">

### Author: ![jjyao](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jjyao/32/1799_2.png) [@jjyao](https://discuss.ray.io/u/jjyao)
#### Post date: [March 17, 2025, 5:07am UTC](https://discuss.ray.io/t/worker-dir-location-referenced-in-environment-variables/22016/2 "2025-03-17T05:07:10Z")

</div>

Hi @christhorn2

Unfortunately, currently it’s not possible. Could you file a Github feature request for it?

---

<div class="post-metadata">

### Author: ![christhorn2](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@christhorn2](https://discuss.ray.io/u/christhorn2)
#### Post date: [March 18, 2025, 10:38pm UTC](https://discuss.ray.io/t/worker-dir-location-referenced-in-environment-variables/22016/3 "2025-03-18T22:38:11Z")

</div>

Yup absolutely, thanks for the reply
