These instructions seems to work just fine with other computer that i have, but with this computer, which i am using right now i get this error:
Runtime error (Exception): CalledProcessError
Traceback:
line 229, in check_output, “C:\Program Files\Rhino 6\Plug-ins\IronPython\Lib\subprocess.py”
line 58, in get_python_from_conda_env, “C:\Users%UserName%\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\ghpythonremote\helpers.py”
line 28, in get_python_path, “C:\Users%UserName%\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\ghpythonremote\helpers.py”
line 20, in init, “C:\Users%UserName%\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\ghpythonremote\connectors.py”
line 49, in script
I have reinstalled and gone through instructions multiple times and I have no glue what i should do right now.
Not sure what the issue is here, sorry. Could you tell me what versions you have installed, by running the following commands?
In the Windows cmd:
conda activate rhinoremote
conda -V
python -V
pip show rpyc
pip show gh-python-remote
In a Rhino Python script:
import rpyc, ghpythonremote, sys, os
from ghpythonremote import version as ghpyrv
print(sys.version)
print(sys.path)
print(rpyc.__version__)
print(rpyc.__path__)
print(ghpyrv.__version__)
print(ghpythonremote.__path__)
I too am having the same issue as Jaakko, and am getting the exact same returns in the panel connected to the ‘out’ of the GH python remote. I tried reinstalling Rhino6 and everything.
If I run the commands I get the following outputs for the versions I am running, ofc in the order you listed above.
conda 4.7.10
Python 2.7.16 :: Anaconda, Inc.
Version: 4.1.2
Version: 1.2.1
When I run your code in a Rhino Python I get the following output
The error above seems to be in the code trying to parse your conda envs to find the path to the python exe that is specified by the conda://rhinoremote location. Could you change that to C:\Users\<username>\.conda\envs\rhinoremote\python.exe as a workaround?
It seems that your suggestion worked in part, as several error codes have been solved. The problem now seems to be that it cannot find rpyc, despite it showing up in my rhinoremote pip list.
Are you absolutely certain that the command C:\Users\<username>\.conda\envs\rhinoremote\python.exe -m pip show rpyc returns the expected RPyC information? The best is to run it in cmd.exe, not in the conda shell.
Do you see a console window popping up when you turn on GHPyRemote?
There is something going on here that I don’t understand… I’ll have to look at this in a debugger, but it won’t be till next week.
Also for some reason the debug logs are not showing up in your GHPythonRemote output. Do you get more info when you open double-click the GHPythonRemote component to open the Python editor, before switching the toggle to on? You might also need to click on “Test” in the editor at some point.
If you feel like doing more debugging yourself, you can try this:
Open an rpyc server in a command prompt: C:\Users\<username>\.conda\envs\rhinoremote\python.exe "%APPDATA%\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\ghpythonremote\pythonservice.py" 18871 DEBUG
You should either get an error message, or some debug messages and a prompt that never returns.
If the first step does not return, it means the sever is running and you can try connecting to it from another console: C:\Users\<username>\.conda\envs\rhinoremote\python.exe -c "import rpyc; c = rpyc.classic.connect('localhost', 18871); print(c)"
The second step should print something like <rpyc.core.protocol.Connection 'conn1' object at 0x0000000003BA47F0>, return, and close the server that was created in the first step.
Thank you for your helping so much, in regards to the debug logs, I previously turned off the debug logs to see the errors, but have turned them back on and below a screenshot of the log is show. Also I took the time to uninstall Anaconda completely and reinstall, but it did not seem to change anything.
I think there is something broken in your RPyC installation. The first error in your second screenshot should definitely not happen in a functioning installation, and I can’t reproduce it here.
Do you maybe have a directory called rpyc somewhere in your home folder, or in the Python path? You can get your python path by running python -c "import sys; print(sys.path)" in a prompt with env rhinoremote activated. The only directory containing a rpyc item should be the last one, ending in site-packages.
Since you reinstalled Conda, I guess that you also went through the installation procedure again for GHPythonRemote and your RPyC installation has not been modified. Still, I’d like to see if the installation logs for RPyC tell us anything. Try a reinstall with these commands, and report if you see any error:
A good way to check if that did anything is to run that debugging command “1.” from my previous message. If you are still in a prompt with rhinoremote activated, you can skip the path to python and run: python "%APPDATA%\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\ghpythonremote\pythonservice.py" 18871 DEBUG
If that still returns the same error as before, please report the output of:
I have recently revisited installing GH Python remote. I did a complete wipe of all my anaconda files and reinstalled Anaconda3, and followed the guide to installing GHPython Remote. It appears that I have managed to solve all the issues apart from an error within the IronPython plugin within Rhinoceros 6. Within Grasshopper the server connection goes without any issues, but when running the block of python code to the right of this startup block, it returns a ''Runtime error (EndofStreamExeption): Stream has been closed" error. In the screenshot below the traceback is shown, and it appears to once again have to do with the rpyc, but this time the files embedded within Rhino 6.
Furthermore command 1 from your reply from October 9 runs without any issues, I did have to change something in the command; for some reason the .conda folder is empty and all of the rhinoremote information regarding the environment is now stored under “C:\Users<username>\Anaconda3\envs\rhinoremote”. Im not sure if this is of any use to you regarding what is happening.
I also reinstalled rpyc according to your instructions from your last post. Below the list of anaconda environments is shown along with the pip list.
Lastly I am not sure if this last piece of information is of any value to you, but within a cmd.exe window when inputting “conda activate rhinoremote” it returns a message stating that my shell has not yet been properly configured to use conda activate.
Hey, that’s much further than last time, looks like we almost got a working install here!
Within Grasshopper the server connection goes without any issues, but when running the block of python code to the right of this startup block, it returns a ''Runtime error (EndofStreamExeption): Stream has been closed" error.
Do you mean that you:
Open the example file in %APPDATA%\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\ghpythonremote\examples\GH_python_remote.ghx,
Switch to True the GHPythonRemote component “run” input, then
Check that the last line in the GHPythonRemoteComponent “out” ouput is INFO: ghpythonremote.GH_to_python: GH to python connection is OPEN, then
With the GHPythonRemote component “run” input still True,
Double click the Python component on the right, click “OK” in the editor that opens, and
Get the output in your screenshot as a result?
Did you modify anything in the example file? Is there anything else in the “out” of the GHPythonRemote component?
If I get the result you showed in the last post, does that mean that GHPython Remote is running as it is supposed to? To be fair, I did have to use the workaround for the location (C:\Users<username>.conda\envs\rhinoremote\python.exe), but I don’t expect this to be an issue?
Thanks for your excellent work.
I wonder whether this is something that will be built in in the next version of Grasshopper or Rhino.
I’ll keep on lobbying for a CPython 3 interpreter in Rhino, that would be a much better solution than forcing that plugin to every installation of GH (I don’t think everyone wants a conda installation on their computer when they install GH :).
You need one import name per submodule you want to use, and it’s a good idea to import the higher-level modules first.
So in the modules input to GHPythonRemote, add scipy.integrate at the bottom of the list and you should be good to go. To use integrate in your GHPython scripts, you will need something like integrate = scriptcontext.sticky['scipy.integrate'].
Maybe good to know that when removing these ‘plot’ lines and testing the code again, the error does not disappear. It removes only when restarting the GHpythonremote component.
I do have matplotlib installed, as I am able to make plots from any other Python editor.
Anybody experiences this problem as well and has an idea about how to fix this?