Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
keyError using example #6
Thanks for this great demo!
However - when I run it (python 3.6 or python 2.7) I get the following problems:
1 - running as is I get no result from the calculation and a console error reporting "Lost remote after 10000ms"
2 - If I instead run the python code in the background (rather than from the electron app) then fire the electron app I see the following errors:
This looks to be something to do with the way strings are being passed around, but any suggestions? Running on OSX
Thanks for your interest. Sorry I don't have Macbook. So let me guess...
First of all, please download the repo as is. The code snippet in
It seems that the problem occurs on the python part.
(Maybe because of incorrect installation of
# strongly recommend: do this inside virtualenv # !! pay attention to this !! pip install gevent pip install pyzmq pip install future # necessary in python 2 pip install msgpack-python pip install zerorpc # run python ./pycalc/api.py ## start running on tcp://127.0.0.1:4242 <- this line should show up?
Open another terminal and run
zerorpc tcp://localhost:4242 calc "1 + 1" ## connecting to "tcp://localhost:4242" <- it should show up ## 2.0 <- it should show up
I believe that, if there are any errors, you should see the errors in the above two steps.
Furthermore, open python and check whether it works:
For example, I have to run something like
And since you run python as it is, and open Electron, then maybe you can try to comment out the python subprocess codes and see if it is ok?
I mean line 10 ~ 61 in https://github.com/fyears/electron-python-example/blob/master/main.js.
Why? Because you don't need to start a subprocess of python from node.js in this case
Thanks for getting back to me so quick. I also have seen the Module mismatch error...
However - all of the tests you suggest above work correctly and as expected. I see no errors. I have also commented out lines starting the python subprocess.
It looks to me that this is something more fundamental in the python node zerorpc ?
When you are doing
Pay attention to your electron version and
Very "interesting"... And I get confused...
Maybe your node.js code could not communicate with python server correctly????
How about this:
If, step 2 goes well, also try to invoke
One more thing, when you are in Windows, checkout the syntax about setting environment variables.
export npm_config_target=1.4.15 # electron version export npm_config_arch=x64 export npm_config_target_arch=x64 export npm_config_disturl=https://atom.io/download/electron export npm_config_runtime=electron export npm_config_build_from_source=true npm config ls