mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Recognize pip installs of RPi.GPIO (#1934)
Fixes "[warn] rpi-gpio : Cannot find Pi RPi.GPIO python library" when it is installed with pip using the default prefix (/usr/local).
This commit is contained in:
		
				
					committed by
					
						 Dave Conway-Jones
						Dave Conway-Jones
					
				
			
			
				
	
			
			
			
						parent
						
							19b6cba398
						
					
				
				
					commit
					4f87ebdf0a
				
			| @@ -24,8 +24,12 @@ module.exports = function(RED) { | ||||
|                 try { | ||||
|                     fs.statSync("/usr/lib/python2.7/dist-packages/RPi/GPIO"); // test on Hypriot | ||||
|                 } catch(err) { | ||||
|                     RED.log.warn("rpi-gpio : "+RED._("rpi-gpio.errors.libnotfound")); | ||||
|                     allOK = false; | ||||
|                     try { | ||||
|                         fs.statSync("/usr/local/lib/python2.7/dist-packages/RPi/GPIO"); // installed with pip | ||||
|                     } catch(err) { | ||||
|                         RED.log.warn("rpi-gpio : "+RED._("rpi-gpio.errors.libnotfound")); | ||||
|                         allOK = false; | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user