# Start node-red on boot doesn't find python module in exec node

**URL:** https://discourse.nodered.org/t/start-node-red-on-boot-doesnt-find-python-module-in-exec-node/11199
**Category:** General
**Created:** [16 May 2019 08:34 UTC](https://discourse.nodered.org/t/start-node-red-on-boot-doesnt-find-python-module-in-exec-node/11199 "2019-05-16T08:34:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![elisascheer](https://avatars.discourse-cdn.com/v4/letter/e/71c47a/32.png) [@elisascheer](https://discourse.nodered.org/u/elisascheer)
#### Post date: [16 May 2019 08:34 UTC](https://discourse.nodered.org/t/start-node-red-on-boot-doesnt-find-python-module-in-exec-node/11199/1 "2019-05-16T08:34:14Z")

</div>

Hi,

I am retrieving values from S7 PLC and passing it as json string argument to a python script.  
I'm using the exec node to exec the .py script

When I launched node-red manually, everything works but when I enable node-red to start automatically on boot, I got python error that no module named found.  
I tried to add the `export PYTHONPATH=$PYTHONPATH:/path/to/module` in the bash script and then exec my python script but still got this error.

Do you have any idea?

Best regards

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [16 May 2019 10:48 UTC](https://discourse.nodered.org/t/start-node-red-on-boot-doesnt-find-python-module-in-exec-node/11199/2 "2019-05-16T10:48:34Z")

</div>

1. what platform and os? i.e RPI running stretch or macOS v 10.13.6?

2. what version of NR, node.js? (get from log at startup)?

3. what is the exact error and where do you see it?

4. what else is in the flow? (an image of the flow is ok, a copy of the flow is better but read this thread before you post it: [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506/3))

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [16 May 2019 12:31 UTC](https://discourse.nodered.org/t/start-node-red-on-boot-doesnt-find-python-module-in-exec-node/11199/3 "2019-05-16T12:31:37Z")

</div>

can you fully path the call to python (in your script) ? - `/usr/bin/python....`  
as well as setting the PYTHONPATH. And maybe also cd into the dir where the .py script is before calling ?  
eg

```
cd ~/mydir/script.py
export PYTHONPATH=....
/usr/bin/python script.py
```
