{"action":"created","issue":{"url":"https://api.github.com/repos/extrabacon/python-shell/issues/154","repository_url":"https://api.github.com/repos/extrabacon/python-shell","labels_url":"https://api.github.com/repos/extrabacon/python-shell/issues/154/labels{/name}","comments_url":"https://api.github.com/repos/extrabacon/python-shell/issues/154/comments","events_url":"https://api.github.com/repos/extrabacon/python-shell/issues/154/events","html_url":"https://github.com/extrabacon/python-shell/issues/154","id":361559273,"node_id":"MDU6SXNzdWUzNjE1NTkyNzM=","number":154,"title":"PythonShell is not a constructor (v1.0.4)","user":{"login":"surfaceowl","id":22673372,"node_id":"MDQ6VXNlcjIyNjczMzcy","avatar_url":"https://avatars2.githubusercontent.com/u/22673372?v=4","gravatar_id":"","url":"https://api.github.com/users/surfaceowl","html_url":"https://github.com/surfaceowl","followers_url":"https://api.github.com/users/surfaceowl/followers","following_url":"https://api.github.com/users/surfaceowl/following{/other_user}","gists_url":"https://api.github.com/users/surfaceowl/gists{/gist_id}","starred_url":"https://api.github.com/users/surfaceowl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/surfaceowl/subscriptions","organizations_url":"https://api.github.com/users/surfaceowl/orgs","repos_url":"https://api.github.com/users/surfaceowl/repos","events_url":"https://api.github.com/users/surfaceowl/events{/privacy}","received_events_url":"https://api.github.com/users/surfaceowl/received_events","type":"User","site_admin":false},"labels":[{"id":85607092,"node_id":"MDU6TGFiZWw4NTYwNzA5Mg==","url":"https://api.github.com/repos/extrabacon/python-shell/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":{"login":"Almenon","id":13080965,"node_id":"MDQ6VXNlcjEzMDgwOTY1","avatar_url":"https://avatars0.githubusercontent.com/u/13080965?v=4","gravatar_id":"","url":"https://api.github.com/users/Almenon","html_url":"https://github.com/Almenon","followers_url":"https://api.github.com/users/Almenon/followers","following_url":"https://api.github.com/users/Almenon/following{/other_user}","gists_url":"https://api.github.com/users/Almenon/gists{/gist_id}","starred_url":"https://api.github.com/users/Almenon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Almenon/subscriptions","organizations_url":"https://api.github.com/users/Almenon/orgs","repos_url":"https://api.github.com/users/Almenon/repos","events_url":"https://api.github.com/users/Almenon/events{/privacy}","received_events_url":"https://api.github.com/users/Almenon/received_events","type":"User","site_admin":false},"assignees":[{"login":"Almenon","id":13080965,"node_id":"MDQ6VXNlcjEzMDgwOTY1","avatar_url":"https://avatars0.githubusercontent.com/u/13080965?v=4","gravatar_id":"","url":"https://api.github.com/users/Almenon","html_url":"https://github.com/Almenon","followers_url":"https://api.github.com/users/Almenon/followers","following_url":"https://api.github.com/users/Almenon/following{/other_user}","gists_url":"https://api.github.com/users/Almenon/gists{/gist_id}","starred_url":"https://api.github.com/users/Almenon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Almenon/subscriptions","organizations_url":"https://api.github.com/users/Almenon/orgs","repos_url":"https://api.github.com/users/Almenon/repos","events_url":"https://api.github.com/users/Almenon/events{/privacy}","received_events_url":"https://api.github.com/users/Almenon/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2018-09-19T03:02:11Z","updated_at":"2018-10-26T16:13:02Z","closed_at":"2018-09-19T03:18:07Z","author_association":"NONE","body":"After upgrading from \"python-shell\": \"0.5.0\" to \"python-shell\": \"1.0.4\", a previously working link that invokes a python script now returns the error  `\"PythonShell is not a constructor\"`\r\n\r\nThe previously working code included:\r\n```\r\n...\r\nconst PythonShell = require(\"python-shell\");\r\n...\r\nlet pyshell = new PythonShell(script, options);\r\n```\r\n\r\nI noticed [that this recent commit](https://github.com/extrabacon/python-shell/commit/ee71a7fec27f6e75d10730c7d44228a09d0c0e67) mentions constructors, but does not seem to change the API.  There is also  this change in the Readme.md\r\n![image](https://user-images.githubusercontent.com/22673372/45728589-67b4ac00-bb7d-11e8-9325-594549f422d6.png)  \r\n\r\n... but the examples below in same the Readme appear to be the same as before v1.0.4.\r\n![image](https://user-images.githubusercontent.com/22673372/45728628-9894e100-bb7d-11e8-99ab-592894ac6681.png)\r\n\r\n\r\nShould I configure something differently, or is this a potential bug?  "},"comment":{"url":"https://api.github.com/repos/extrabacon/python-shell/issues/comments/433461603","html_url":"https://github.com/extrabacon/python-shell/issues/154#issuecomment-433461603","issue_url":"https://api.github.com/repos/extrabacon/python-shell/issues/154","id":433461603,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMzQ2MTYwMw==","user":{"login":"shayfer","id":25122376,"node_id":"MDQ6VXNlcjI1MTIyMzc2","avatar_url":"https://avatars1.githubusercontent.com/u/25122376?v=4","gravatar_id":"","url":"https://api.github.com/users/shayfer","html_url":"https://github.com/shayfer","followers_url":"https://api.github.com/users/shayfer/followers","following_url":"https://api.github.com/users/shayfer/following{/other_user}","gists_url":"https://api.github.com/users/shayfer/gists{/gist_id}","starred_url":"https://api.github.com/users/shayfer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shayfer/subscriptions","organizations_url":"https://api.github.com/users/shayfer/orgs","repos_url":"https://api.github.com/users/shayfer/repos","events_url":"https://api.github.com/users/shayfer/events{/privacy}","received_events_url":"https://api.github.com/users/shayfer/received_events","type":"User","site_admin":false},"created_at":"2018-10-26T16:13:02Z","updated_at":"2018-10-26T16:13:02Z","author_association":"NONE","body":"Good call! I tried installing via pip install opencv-python. That results in Pip fails with Could not find a version that satisfies the requirement ...  I next tried pip install --upgrade pip which did result in a successful installation.  I am getting a slightly different error message now.  I did reboot after the install and I would guess the order of installing PIP after Python shouldn't matter?\r\n\r\nSyntaxError: Unexpected token T in JSON at position 0\r\n    at JSON.parse (<anonymous>)\r\n    at PythonShell.asJson (/home/pi/MagicMirror/modules/MMM-Motion-Detection/node_modules/python-shell/index.js:350:21)\r\n    at /home/pi/MagicMirror/modules/MMM-Motion-Detection/node_modules/python-shell/index.js:302:42\r\n    at Array.forEach (<anonymous>)\r\n    at PythonShell.recieveInternal (/home/pi/MagicMirror/modules/MMM-Motion-Detection/node_modules/python-shell/index.js:298:15)\r\n    at PythonShell.receiveStderr (/home/pi/MagicMirror/modules/MMM-Motion-Detection/node_modules/python-shell/index.js:282:21)\r\n    at Socket.<anonymous> (/home/pi/MagicMirror/modules/MMM-Motion-Detection/node_modules/python-shell/index.js:100:18)\r\n    at emitOne (events.js:116:13)\r\n    at Socket.emit (events.js:211:7)\r\n    at addChunk (_stream_readable.js:263:12)\r\n{ Error: ImportError: No module named 'cv2'\r\n    at PythonShell.parseError (/home/pi/MagicMirror/modules/MMM-Motion-Detection/node_modules/python-shell/index.js:232:21)\r\n    at terminateIfNeeded (/home/pi/MagicMirror/modules/MMM-Motion-Detection/node_modules/python-shell/index.js:121:32)\r\n    at ChildProcess.<anonymous> (/home/pi/MagicMirror/modules/MMM-Motion-Detection/node_modules/python-shell/index.js:113:13)\r\n    at emitTwo (events.js:126:13)\r\n    at ChildProcess.emit (events.js:214:7)\r\n    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)\r\n    ----- Python Traceback -----\r\n    File \"modules/MMM-Motion-Detection/motiondetection/motiondetection.py\", line 19, in <module>\r\n      import cv2\r\n  traceback: 'Traceback (most recent call last):\\n  File \"modules/MMM-Motion-Detection/motiondetection/motiondetection.py\", line 19, in <module>\\n    import cv2\\nImportError: No module named \\'cv2\\'\\n',\r\n  executable: 'python3',\r\n  options: null,\r\n  script: 'modules/MMM-Motion-Detection/motiondetection/motiondetection.py',\r\n  args: \r\n   [ '{\"useUSBCam\":false,\"interval\":1,\"motionStopDelay\":120,\"detectionThreshold\":1000,\"turnOffDisplay\":true}' ],\r\n  exitCode: 1 }\r\n"}}
{"actor":{"display_login":"shayfer"}}