-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
keyError using example #6
Comments
Hi. Thanks for your interest. Sorry I don't have Macbook. So let me guess... 1First 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 run # 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: import gevent For example, I have to run something like 2And 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 |
There is another problem. After npm installed dependencies there is an "Uncaught Error: Module version mismatch. Expected 50, got 51." bindings.js:83 |
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
Then
And try 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 The above |
@fyears, I'm using Arch Linux with Python 3.6.
|
Not quite sure how I have fixed this, but a complete rebuild of electron and cleaning up of node seems to have worked. Thanks for the cool demo! |
@ar7max By the way, may you consider removing my personal blog repo from your account? If necessary you may just fork the current dev repo instead of the blog repo. Thank you! :-) |
@fyears, done. |
Hi,
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
The text was updated successfully, but these errors were encountered: