# Having issues with python3 and HA node red add-on

**URL:** <https://discourse.nodered.org/t/having-issues-with-python3-and-ha-node-red-add-on/64901>\
**Category:** General\
**Tags:** home-assistant\
**Created:** [10 July 2022 10:51 UTC](https://discourse.nodered.org/t/having-issues-with-python3-and-ha-node-red-add-on/64901 "2022-07-10T10:51:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bydandie](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bydandie/32/64417_2.png) [@Bydandie](https://discourse.nodered.org/u/Bydandie)\
**Post date:** [10 July 2022 10:51 UTC](https://discourse.nodered.org/t/having-issues-with-python3-and-ha-node-red-add-on/64901/1 "2022-07-10T10:51:55Z")

</div>

Hi all, so I have a RPi 4 installed with HAOS on it, and have added node-red as an add-on.

I'm trying to run a python script to communicate with my sofar solar inverter called sofar.py. When I run the script in terminal using "python3 /home/pi/Documents/sofar.py" it returns all the values fine but when I run the same command in an exec node I get the error.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/7/c73cc60b6f081d888c11b7f181af0ae05499913b.jpeg)

Any idea what the issue is? From what I can see I need to call the full path to python3 but when I run an exec node with the common "pwd" I get back '/opt'. Don't know where to go from here ☹

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [10 July 2022 11:12 UTC](https://discourse.nodered.org/t/having-issues-with-python3-and-ha-node-red-add-on/64901/2 "2022-07-10T11:12:42Z")

</div>

Welcome to the forum @Bydandie

You can use the command  
`which python`  
to find out where it is, probably something like `/usr/bin/python`. Then use that in the exec node.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [10 July 2022 11:30 UTC](https://discourse.nodered.org/t/having-issues-with-python3-and-ha-node-red-add-on/64901/3 "2022-07-10T11:30:53Z")

</div>

I think that this "HAOS" is using docker containers for things like node-red ? no way to break out of a container.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [10 July 2022 12:32 UTC](https://discourse.nodered.org/t/having-issues-with-python3-and-ha-node-red-add-on/64901/4 "2022-07-10T12:32:53Z")

</div>

If it is using a docker container for node red then, if you open a console in the container, can you run your command?

---

<div class="post-metadata">

**Author:** ![Bydandie](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bydandie/32/64417_2.png) [@Bydandie](https://discourse.nodered.org/u/Bydandie)\
**Post date:** [10 July 2022 14:14 UTC](https://discourse.nodered.org/t/having-issues-with-python3-and-ha-node-red-add-on/64901/5 "2022-07-10T14:14:37Z")

</div>

Cheers, how do I run a console in there?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [10 July 2022 15:04 UTC](https://discourse.nodered.org/t/having-issues-with-python3-and-ha-node-red-add-on/64901/6 "2022-07-10T15:04:53Z")

</div>

I have no idea. That is a Docker or HA question. Perhaps ask on an HA forum.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [8 September 2022 15:05 UTC](https://discourse.nodered.org/t/having-issues-with-python3-and-ha-node-red-add-on/64901/7 "2022-09-08T15:05:40Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
