Cannot run scripts using Atom and RhinoPython

Hi there,

I’m having some problems connecting Rhino and Atom using the RhinoPython package. Mainly I cannot run scripts from Atom using "Save and Run in Rhino, " neither using the shortcut nor from the main menu.

I see “Listening for Atom editor requests” in Rhino, but when I try to run in Atom I get " Rhino isn’t listening for requests. Run the “StartAtomEditorListener” command from within Rhino."

Auto-complete was not working at first, but now works after a couple re-launches.

I tried both default port 8080 and 65000.
When I go to http://localhost:65000/ping, I get “{“msg”:“Talk to me”,“source”:”"}"

Looks like many people have had this issue over the years - I’ve tried previous suggestions and nothing is working. :frowning:

When you run this command in the terminal to you see Rhino listed?

lsof -P -iTCP -sTCP:LISTEN

For example, when I run this on my system, I see Rhino is listening on port 8080:

COMMAND    PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
Rhinocero 5653 Kevin   17u  IPv6 0xb6dd1a7456a87d7d      0t0  TCP localhost:8080 (LISTEN)

(along with the other listening ports on my system)

From the man page for lsof under the section for the -s switch

For example, to list only network files with TCP state LISTEN, use:
                     -iTCP -sTCP:LISTEN

Adding the -P switch inhibits the conversion of port numbers to port names.

When I go to http://localhost:8080/ping (as you listed above), I see:

{"msg":"/Applications/Rhino V6/Rhinoceros.app","source":"Assembly path"}

Also, when I run the command _StartAtomEditorListener in Rhino the command history shows:

Listening for Atom editor requests on port 8080 ...

Are you seeing this?

Are you running any kind of firewall software that might be interfering?

-Kevin

Thanks for your reply Kevin.

In terminal I do see that Rhino is listening on port 65000 (as I set).

COMMAND     PID   USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
Rhinocero 24091 Malika   55u  IPv6 0x9a4bfec10e783d57      0t0  TCP localhost:65000 (LISTEN)

And in Rhino I also see the command history showing

Listening for Atom editor requrests on port 65000...

The only difference is when I go to http://localhost:65000/ping, I see

{"msg":"Talk to me","source":""}

I don’t have any firewalls either!

Strange, what version of Rhino are you running?

With Version 6 (6.28.20175.16482, 2020-06-23) after running StartAtomEditorListener and then going to http://localhost:65000/ping I get this response:

{"msg":"/Applications/Rhino V6/Rhinoceros.app","source":"Assembly path"}

If I try it while running the Version 7 WIP (7.0.20182.12006, 2020-06-30) I get this response:

{"msg":"/Applications/RhinoWIP.app","source":"Assembly path"}

From searching the forum for this problem, these seem like the normal responses. I tried ports 8080 and 65000 and both seem to work for me.

Seems like your Rhino is corrupted or some other program is responding to the ping request. Have you tried re-installing Rhino? If that doesn’t help I’m afraid I don’t have any other suggestions - I’m just a regular user following these forums trying to learn and help where I can. Hopefully @Alain or @dan can offer some more suggestions (they were both active in other posts about this problem).

-Kevin

Is the Atom rhino-python package also set to port number 65000?

cmd + , for the Settings tab then find rhino-python under Packages.

Reviving this old thread because I am now experiencing the same problem as @malikakhurana23 when running the Version 7 BETA (7.0.20309.06004, 2020-11-04).

I have RhinoBETA set to listen on port 8080 and when I run:

_StartAtomEditorListener

I get the response:

Listening for Atom editor requests on port 8080 …

When I try to run a python script from atom, I get the response:

Rhino isn’t listening for requests. Run the “StartAtomEditorListener” command from within Rhino.

Going to http://localhost:8080/ping in my browser while RhinoBETA is listening for Atom editor requests produces this response:

{“msg”:“Talk to me”,“source”:""}

All works as expected when I am running Rhino Version 6 (6.31.20308.11002, 2020-11-03) and going to http://localhost:8080/ping in my browser while V6 is listening for Atom editor requests produces this response:

{“msg”:"/Applications/Rhinoceros.app",“source”:“Assembly path”}

The Atom editor can only communicate with Rhino if the app package name is ‘Rhinoceros.app’ or ‘RhinoWIP.app’. The users’ is ‘RhinoBETA.app’. I’ll push a fix for the next release.

In the meantime a workaround is to rename ‘RhinoBETA.app’ to either ‘Rhinoceros.app’ or ‘RhinoWIP.app’.

@brian, is it safe to tell the user to rename the file or will that cause confusion/problems with future installs?

It might be that just downloading the Rhino 7 Eval from https://www.rhino3d.com/download/rhino/7/evaluation will fix this problem. Be sure to uninstall the BETA first.

I renamed ‘RhinoBETA.app’ to 'RhinoWIP.app’ and it resolved the problem - I will change the name back before I try to install any updates to avoid possible conflicts.

I noticed Rhino V7 had been released, so I upgraded my license and downloaded the new version.

Back to the same problem again (can’t run scripts from Atom).

The new version is named ‘Rhino 7.app’ - renamed to ‘Rhinoceros.app’ and it works.

That will be fixed in the next release. You’ll also need to update you Atom package.

RH-61407 is fixed in the latest Service Release Candidate