TypeError: PythonShell.run is not a function
See original GitHub issue点击手机显示打开然后秒关闭。终端提示错误信息如下,求大神解答。
root@raspberrypi:~# node HomeKitAppleDeveloper/Core.js
HomeKit Apple Developer starting...
Change: true
/root/HomeKitAppleDeveloper/accessories/HomeKitAppleDeveloper_accessory.js:82
PythonShell.run('../project/open.py', function (err) {
^
TypeError: PythonShell.run is not a function
at onUpdate (/root/HomeKitAppleDeveloper/accessories/HomeKitAppleDeveloper_accessory.js:82:25)
at Characteristic.<anonymous> (/root/HomeKitAppleDeveloper/lib/AccessoryLoader.js:164:7)
at Characteristic.emit (events.js:182:13)
at Characteristic.setValue (/root/HomeKitAppleDeveloper/lib/Characteristic.js:320:10)
at Accessory.<anonymous> (/root/HomeKitAppleDeveloper/lib/Accessory.js:871:22)
at Array.forEach (<anonymous>)
at Accessory._handleSetCharacteristics (/root/HomeKitAppleDeveloper/lib/Accessory.js:811:8)
at HAPServer.emit (events.js:182:13)
at HAPServer._handleCharacteristics (/root/HomeKitAppleDeveloper/lib/HAPServer.js:972:10)
at HAPServer.<anonymous> (/root/HomeKitAppleDeveloper/lib/HAPServer.js:209:39)
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
PythonShell.run is not a function · Issue #151 - GitHub
this error means that PythonShell is undefined. Are you trying to require python-shell by any chance? Or are you importing it?
Read more >NodeJS and Python-Shell .run function doesn't print STDOUT
I can get prints by using pythonShell.on and pythonShell.end. The problem is that I can't send args with this method. Then I use...
Read more >How to use the python-shell.run function in python-shell - Snyk
To help you get started, we've selected a few python-shell.run examples, based on popular ways it ... PythonShell.run(str, function(err) { if (!process.env.
Read more >python-shell - npm
Run Python scripts from Node.js with simple (but efficient) inter-process communication through stdio. Latest version: 3.0.1, ...
Read more >Run Python Script using PythonShell from Node.js
Conclusion. This is the simple implementation of a how-to run python script with Node. js which can be useful in situations where you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You guys probably tried such like
I got a same error, so I changed a little.
It works.
@ykm11 … this works …but folks the problem is I think from the python file Path:
for mine, I did not state the path correctly. Please check your .py file path