RPC proxy not working with implicit start from Rhino/Grasshopper
See original GitHub issueDescribe the bug
Using compas_rpc.Proxy
as a contextmanager raises an exception. This only happens if a RPC server is not already running. (Same/similar to #265)
To Reproduce Steps to reproduce the behavior:
Context: Grasshopper GHPython node or Rhino python editor.
Sample script
from compas.rpc import Proxy
from compas.geometry import Point
pt1 = Point(1, 2, 3)
with Proxy("compas.geometry", max_conn_attempts=5) as proxy:
pt2 = proxy.Point(1, 2, 3)
if list(pt1) == pt2:
print("Success")
- Traceback
Message: Traceback (most recent call last):
File "C:\Users\a\scoop\apps\miniconda3\4.7.12.1\envs\compas_rr_ts-dev\lib\site-packages\compas\rpc\dispatcher.py", line 100, in _dispatch
module = importlib.import_module(modulename)
File "C:\Users\a\scoop\apps\miniconda3\4.7.12.1\envs\compas_rr_ts-dev\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\a\scoop\apps\miniconda3\4.7.12.1\envs\compas_rr_ts-dev\lib\site-packages\compas\geometry\__init__.py", line 497, in <module>
from .bbox import * # noqa: F401 F403
File "C:\Users\a\scoop\apps\miniconda3\4.7.12.1\envs\compas_rr_ts-dev\lib\site-packages\compas\geometry\bbox\__init__.py", line 10, in <module>
from .bbox_numpy import * # noqa: F401 F403
File "C:\Users\a\scoop\apps\miniconda3\4.7.12.1\envs\compas_rr_ts-dev\lib\site-packages\compas\geometry\bbox\bbox_numpy.py", line 24, in <module>
from compas.numerical import pca_numpy
File "C:\Users\a\scoop\apps\miniconda3\4.7.12.1\envs\compas_rr_ts-dev\lib\site-packages\compas\numerical\__init__.py", line 109, in <module>
from .isolines import * # noqa: F401 F403
File "C:\Users\a\scoop\apps\miniconda3\4.7.12.1\envs\compas_rr_ts-dev\lib\site-packages\compas\numerical\isolines\__init__.py", line 8, in <module>
from .isolines_numpy import * # noqa: F401 F403
File "C:\Users\a\scoop\apps\miniconda3\4.7.12.1\envs\compas_rr_ts-dev\lib\site-packages\compas\numerical\isolines\isolines_numpy.py", line 11, in <module>
import matplotlib.pyplot as plt
File "C:\Users\a\scoop\apps\miniconda3\4.7.12.1\envs\compas_rr_ts-dev\lib\site-packages\matplotlib\__init__.py", line 174, in <module>
_check_versions()
File "C:\Users\a\scoop\apps\miniconda3\4.7.12.1\envs\compas_rr_ts-dev\lib\site-packages\matplotlib\__init__.py", line 159, in _check_versions
from . import ft2font
ImportError: DLL load failed while importing ft2font: %1 is not a valid Win32 application.
Traceback:
line 345, in _proxy, "C:\Users\a\AppData\Roaming\McNeel\Rhinoceros\6.0\scripts\compas\rpc\proxy.py"
line 4, in <module>, "C:\Users\a\AppData\Local\Temp\TempScript.py"
Expected behavior Print “Success”.
Desktop (please complete the following information):
- OS: Win10
- Python version 2.7.8 (IronPython 2.7.8 (2.7.8.0) on .NET 4.0.30319.42000 (64-bit))
- Python package manager: Anaconda
- compas version: 0.19.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:45 (45 by maintainers)
Top Results From Across the Web
rpc - COMPAS
The other one is called RPC , which stands for Remote Procedure Call` and it allows to create a transparent proxy/connection between our...
Read more >What is the correct way to serialize data for rpc in grasshopper
I'm running into a seemingly simple problem where I am unable to pass a compas mesh to an rpc proxy: In grasshopper, I...
Read more >RPC Proxy doesn't work: 2013/2010 Co-Existence ... - TechNet
I'm working on a new client and they have it. Mailboxes on 2010 do not work with external outlook anywhere with the 2013...
Read more >Untitled
2 syllable boy names starting with k, Wurst online einkaufen, ... Ouderkerk voetbal, Msn video not working firefox, Bindawood offers jeddah, ...
Read more >Untitled
Provocadora mujer, Crowie running, Essay about national festivals of india, Asus m32ad-tr002s, Baden import weihnachten, Steenmarters op zolder, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That environment only had a compas 0.19.1 and an editable install of a package I tested compas.plugin with.
Just tested this on another computer with miniconda and it worked. Seems like my plugin package is the culprit.
I’ll investigate further, I’ll reopen if necessary.
This fixed it for me.