# Nrpgio Python command not running

**URL:** <https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943>\
**Category:** General\
**Created:** [26 September 2019 10:41 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943 "2019-09-26T10:41:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![GregorR1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorr1/32/12263_2.png) [@GregorR1](https://discourse.nodered.org/u/GregorR1)\
**Post date:** [26 September 2019 10:41 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/1 "2019-09-26T10:41:28Z")

</div>

Hi,

I'm setting up some test flows to test out my projects integration to GitHub and Balena. I created a very simple flow of an inject node, a trigger node and a GPIO out node to turn on and off an LED.

The issue is that for some reason I am hit with this error:  
[error] [rpi-gpio out:5508a8b9.eff008] nrpgio python command not running

I am using a fresh install of rasbian from the most recent NOOBS from [https://www.raspberrypi.org/downloads/noobs/](https://www.raspberrypi.org/downloads/noobs/)

I have not updated anything since installing the NOOBS. I am using the node-red version that came bundled with the OS.

Can anyone suggest what could be causing this error?

Do I need to add the python script to the Node-Red project?

Thanks,  
Gregor

---

<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:** [26 September 2019 10:43 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/2 "2019-09-26T10:43:31Z")

</div>

The version delivered with raspbian is not up to date.  
Follow this [installation guide.](https://nodered.org/docs/getting-started/raspberrypi)

---

<div class="post-metadata">

**Author:** ![GregorR1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorr1/32/12263_2.png) [@GregorR1](https://discourse.nodered.org/u/GregorR1)\
**Post date:** [26 September 2019 10:46 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/3 "2019-09-26T10:46:19Z")

</div>

Thanks for the response. I tried using the command from your link but this was the response:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/2796f2255f0f7a55824bf9f4244a016a5255298d.png)

---

<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:** [26 September 2019 10:47 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/4 "2019-09-26T10:47:47Z")

</div>

Please read the guide again:

`bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)`

---

<div class="post-metadata">

**Author:** ![GregorR1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorr1/32/12263_2.png) [@GregorR1](https://discourse.nodered.org/u/GregorR1)\
**Post date:** [26 September 2019 10:49 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/5 "2019-09-26T10:49:08Z")

</div>

Sorry, apparently I can't read - I'll run the bash script just now.

Thanks

---

<div class="post-metadata">

**Author:** ![GregorR1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorr1/32/12263_2.png) [@GregorR1](https://discourse.nodered.org/u/GregorR1)\
**Post date:** [26 September 2019 11:12 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/6 "2019-09-26T11:12:36Z")

</div>

Hi, even after the update I am still getting the same error. Any ideas?

I can't think what could be causing it. The only thing I've done differently from normal is that I'm using the projects, could it be something to do with that?

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [26 September 2019 11:28 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/7 "2019-09-26T11:28:56Z")

</div>

Can you restart node-red and post the first part of the output log until the part it says it’s available on :? Sounds like there might still be a version mismatch somewhere. It will also show the exact error you’re getting.

As for the python script, it is bundled with the gpio node. It should be run by the output node in the background to interact.

---

<div class="post-metadata">

**Author:** ![GregorR1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorr1/32/12263_2.png) [@GregorR1](https://discourse.nodered.org/u/GregorR1)\
**Post date:** [26 September 2019 11:32 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/8 "2019-09-26T11:32:04Z")

</div>

Hi afelix,

Here is the whole output from starting Node-red:

```auto
pi@MSAT-Master:~ $ node-red-stop && node-red-start

Stop Node-RED
 
Use node-red-start to start Node-RED again
 

Start Node-RED
 
Once Node-RED has started, point a browser at http://192.168.1.107:1880
On Pi Node-RED works better with the Firefox or Chrome browser
 
Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot
 
To find more nodes and example flows - go to http://flows.nodered.org
 
Starting as a systemd service.
26 Sep 12:31:02 - [info]
Welcome to Node-RED
===================
26 Sep 12:31:02 - [info] Node-RED version: v0.20.8
26 Sep 12:31:02 - [info] Node.js version: v10.16.3
26 Sep 12:31:02 - [info] Linux 4.19.57-v7l+ arm LE
26 Sep 12:31:03 - [info] Loading palette nodes
26 Sep 12:31:05 - [info] Dashboard version 2.16.3 started at /ui
26 Sep 12:31:06 - [info] Settings file : /home/pi/.node-red/settings.js
26 Sep 12:31:06 - [info] Context store : 'default' [module=memory]
26 Sep 12:31:06 - [info] User directory : /home/pi/.node-red
26 Sep 12:31:06 - [info] Server now running at http://127.0.0.1:1880/
26 Sep 12:31:06 - [info] Active project : MSAT-EC-Twinfan
26 Sep 12:31:06 - [info] Flows file : /home/pi/.node-red/projects/MSAT-EC-Twinfan/flows_MSAT-Master_EC-Twinfan.json
26 Sep 12:31:06 - [info] Starting flows
26 Sep 12:31:06 - [info] Started flows
26 Sep 12:31:06 - [error] [rpi-gpio out:5508a8b9.eff008] nrpgio python command not running

```

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [26 September 2019 11:57 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/9 "2019-09-26T11:57:51Z")

</div>

Okay have an idea now, can you upload both your package.json as well as package\_lock.json?

---

<div class="post-metadata">

**Author:** ![GregorR1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorr1/32/12263_2.png) [@GregorR1](https://discourse.nodered.org/u/GregorR1)\
**Post date:** [26 September 2019 12:00 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/10 "2019-09-26T12:00:11Z")

</div>

Hi, will this be in the project folder or the .node-red folder?

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [26 September 2019 12:03 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/11 "2019-09-26T12:03:25Z")

</div>

Project folder

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [26 September 2019 12:04 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/12 "2019-09-26T12:04:02Z")

</div>

Could it be this?  
[https://www.raspberrypi.org/forums/viewtopic.php?t=216925](https://www.raspberrypi.org/forums/viewtopic.php?t=216925)

---

<div class="post-metadata">

**Author:** ![GregorR1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorr1/32/12263_2.png) [@GregorR1](https://discourse.nodered.org/u/GregorR1)\
**Post date:** [26 September 2019 12:06 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/13 "2019-09-26T12:06:22Z")

</div>

Okay, so in the project folder there is a package.json but no package\_lock.json.

[package.json](https://discourse.nodered.org/uploads/short-url/f4EIU7PWU3R9LQ3FssmAvsflubA.json) (684 Bytes)

Should there be a package\_lock.json in the projects folder?

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [26 September 2019 12:06 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/14 "2019-09-26T12:06:48Z")

</div>

Pretty sure it’s that. The error matches the “python command not found” error message. My gut says there’s a version mismatch/incompatibility somewhere

---

<div class="post-metadata">

**Author:** ![GregorR1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorr1/32/12263_2.png) [@GregorR1](https://discourse.nodered.org/u/GregorR1)\
**Post date:** [26 September 2019 12:12 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/15 "2019-09-26T12:12:43Z")

</div>

What would you suggest my next step? I'm out of my depth with this sort of stuff - it normally works fine from the fresh install.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [26 September 2019 12:16 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/16 "2019-09-26T12:16:30Z")

</div>

[https://linuxconfig.org/how-to-change-from-default-to-alternative-python-version-on-debian-linux](https://linuxconfig.org/how-to-change-from-default-to-alternative-python-version-on-debian-linux)

Check to see what is the default first. we are guessing it is v3

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [26 September 2019 12:16 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/17 "2019-09-26T12:16:56Z")

</div>

I’m going to check the python code to see if there’s actually an incompatibility, and if so do a PR to make it able to handle both versions if possible.

---

<div class="post-metadata">

**Author:** ![GregorR1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorr1/32/12263_2.png) [@GregorR1](https://discourse.nodered.org/u/GregorR1)\
**Post date:** [26 September 2019 12:18 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/18 "2019-09-26T12:18:00Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/5e3d7f0a3ac95bd7bea16e041703158171c7584a.png)

Apparently my default python is 2.7.16

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [26 September 2019 12:37 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/19 "2019-09-26T12:37:13Z")

</div>

yeah, and the code is already compatible so it _should_ execute...

Can you execute the following commands from the terminal:  
`ls -ahl /usr/lib/node_modules/node-red/node_modules/@node-red/nodes/core/hardware/`  
Then, if that doesn't give an error test the following:  
`python /usr/lib/node_modules/node-red/node_modules/@node-red/nodes/core/hardware/nrgpio.py`

If that gives the following error

```auto
Traceback (most recent call last):
  File "nrgpio.py", line 17, in <module>
    import RPi.GPIO as GPIO
ModuleNotFoundError: No module named 'RPi'

```

your next step should be to install the RPi python module on the device. To install that in the global python system that executes at `/usr/bin/python`, type `sudo pip install RPi.GPIO`.

If it doesn't get that error, I've no clue at all what is going wrong here.

---

<div class="post-metadata">

**Author:** ![GregorR1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorr1/32/12263_2.png) [@GregorR1](https://discourse.nodered.org/u/GregorR1)\
**Post date:** [26 September 2019 13:00 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/20 "2019-09-26T13:00:46Z")

</div>

Hi afelix,

Thanks for the detailed instructions. I've run these commands and am getting this response:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/fde1e45372bf5afddff80b48af261a7b84e194d4.png)

Unfortunately not the same error as you had.

Thanks

Edit: Is this because I'm running it without providing the parameters that node-red would?

[Next page](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943.md?page=2)
