Hops broken in Rhino 7.13? Cannot deserialized JSON array

Hi,

Hops 0.9.0 from the PackageManager currently doesn’t seem to work at all in Rhino 7 (7.13.21313.11002, 2021-11-09):

The Flask server runs fine in debugging mode.

I’ve installed all CPython dependencies in a virtualenv, like I pretty much always do:

And I’ve tested numerous, previously working scripts of mine and all produce the same error.

I’m currently using CPython 3.9.7.

Thanks for the question. I just tested Hops on the same build your running, and the example flask server seems to run fine on my machine. The only difference in my setup is that I’m running Python 3.10 and have the latest version of pip installed. Have you tried upgrading python to (3.10) and pip to (21.3.1) and then trying to reinstall flask and the ghhops_server?

Alternatively, you could downgrade Hops to the previous version (via the package manager) to see if it’s something in the new build that is broken.

If you downgrade to Hops 0.8.0, do things work?

Also, you may be able to get more information about the error if you turn on debug mode for flask.

I’ve installed Python 3.10.0 and upgraded pip to 21.3.1 and now rhino3dm fails to install inside the virtual environment.

Collecting rhino3dm
  Using cached rhino3dm-7.7.0.tar.gz (5.5 MB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: rhino3dm
  Building wheel for rhino3dm (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/marc/Desktop/hops_test/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/dq/n7fdtfps47s3c21pbw7ybl100000gn/T/pip-install-0dpp74q5/rhino3dm_6a2487087be2492f8b0b165a799f12d3/setup.py'"'"'; __file__='"'"'/private/var/folders/dq/n7fdtfps47s3c21pbw7ybl100000gn/T/pip-install-0dpp74q5/rhino3dm_6a2487087be2492f8b0b165a799f12d3/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/dq/n7fdtfps47s3c21pbw7ybl100000gn/T/pip-wheel-2poomgs1
       cwd: /private/var/folders/dq/n7fdtfps47s3c21pbw7ybl100000gn/T/pip-install-0dpp74q5/rhino3dm_6a2487087be2492f8b0b165a799f12d3/
  Complete output (62 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-11-x86_64-3.10
  creating build/lib.macosx-11-x86_64-3.10/rhino3dm
  copying src/rhino3dm/__init__.py -> build/lib.macosx-11-x86_64-3.10/rhino3dm
  running egg_info
  writing src/rhino3dm.egg-info/PKG-INFO
  writing dependency_links to src/rhino3dm.egg-info/dependency_links.txt
  writing top-level names to src/rhino3dm.egg-info/top_level.txt
  reading manifest file 'src/rhino3dm.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no files found matching '*.pyd' under directory 'src/rhino3dm'
  warning: no files found matching '*.so' under directory 'src/rhino3dm'
  adding license file 'LICENSE'
  writing manifest file 'src/rhino3dm.egg-info/SOURCES.txt'
  copying src/rhino3dm/__init__.pyi -> build/lib.macosx-11-x86_64-3.10/rhino3dm
  copying src/rhino3dm/py.typed -> build/lib.macosx-11-x86_64-3.10/rhino3dm
  running build_ext
  Traceback (most recent call last):
    File "/private/var/folders/dq/n7fdtfps47s3c21pbw7ybl100000gn/T/pip-install-0dpp74q5/rhino3dm_6a2487087be2492f8b0b165a799f12d3/setup.py", line 32, in run
      out = subprocess.check_output(['cmake', '--version'])
    File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 420, in check_output
      return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
    File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 501, in run
      with Popen(*popenargs, **kwargs) as process:
    File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 966, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,
    File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 1842, in _execute_child
      raise child_exception_type(errno_num, err_msg, err_filename)
  FileNotFoundError: [Errno 2] No such file or directory: 'cmake'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/var/folders/dq/n7fdtfps47s3c21pbw7ybl100000gn/T/pip-install-0dpp74q5/rhino3dm_6a2487087be2492f8b0b165a799f12d3/setup.py", line 111, in <module>
      setup(
    File "/Users/marc/Desktop/hops_test/venv/lib/python3.10/site-packages/setuptools/__init__.py", line 159, in setup
      return distutils.core.setup(**attrs)
    File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/Users/marc/Desktop/hops_test/venv/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
      self.run_command('build')
    File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/private/var/folders/dq/n7fdtfps47s3c21pbw7ybl100000gn/T/pip-install-0dpp74q5/rhino3dm_6a2487087be2492f8b0b165a799f12d3/setup.py", line 34, in run
      raise RuntimeError(
  RuntimeError: CMake must be installed to build the following extensions: rhino3dm._rhino3dm
  ----------------------------------------
  ERROR: Failed building wheel for rhino3dm
  Running setup.py clean for rhino3dm
Failed to build rhino3dm
Installing collected packages: rhino3dm
    Running setup.py install for rhino3dm ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/marc/Desktop/hops_test/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/dq/n7fdtfps47s3c21pbw7ybl100000gn/T/pip-install-0dpp74q5/rhino3dm_6a2487087be2492f8b0b165a799f12d3/setup.py'"'"'; __file__='"'"'/private/var/folders/dq/n7fdtfps47s3c21pbw7ybl100000gn/T/pip-install-0dpp74q5/rhino3dm_6a2487087be2492f8b0b165a799f12d3/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/dq/n7fdtfps47s3c21pbw7ybl100000gn/T/pip-record-gu0mcv_e/install-record.txt --single-version-externally-managed --compile --install-headers /Users/marc/Desktop/hops_test/venv/include/site/python3.10/rhino3dm
         cwd: /private/var/folders/dq/n7fdtfps47s3c21pbw7ybl100000gn/T/pip-install-0dpp74q5/rhino3dm_6a2487087be2492f8b0b165a799f12d3/
    Complete output (66 lines):
    running install
    /Users/marc/Desktop/hops_test/venv/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    running build
    running build_py
    creating build
    creating build/lib.macosx-11-x86_64-3.10
    creating build/lib.macosx-11-x86_64-3.10/rhino3dm
    copying src/rhino3dm/__init__.py -> build/lib.macosx-11-x86_64-3.10/rhino3dm
    running egg_info
    writing src/rhino3dm.egg-info/PKG-INFO
    writing dependency_links to src/rhino3dm.egg-info/dependency_links.txt
    writing top-level names to src/rhino3dm.egg-info/top_level.txt
    reading manifest file 'src/rhino3dm.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching '*.pyd' under directory 'src/rhino3dm'
    warning: no files found matching '*.so' under directory 'src/rhino3dm'
    adding license file 'LICENSE'
    writing manifest file 'src/rhino3dm.egg-info/SOURCES.txt'
    copying src/rhino3dm/__init__.pyi -> build/lib.macosx-11-x86_64-3.10/rhino3dm
    copying src/rhino3dm/py.typed -> build/lib.macosx-11-x86_64-3.10/rhino3dm
    running build_ext
    Traceback (most recent call last):
      File "/private/var/folders/dq/n7fdtfps47s3c21pbw7ybl100000gn/T/pip-install-0dpp74q5/rhino3dm_6a2487087be2492f8b0b165a799f12d3/setup.py", line 32, in run
        out = subprocess.check_output(['cmake', '--version'])
      File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 420, in check_output
        return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
      File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 501, in run
        with Popen(*popenargs, **kwargs) as process:
      File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 966, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 1842, in _execute_child
        raise child_exception_type(errno_num, err_msg, err_filename)
    FileNotFoundError: [Errno 2] No such file or directory: 'cmake'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/dq/n7fdtfps47s3c21pbw7ybl100000gn/T/pip-install-0dpp74q5/rhino3dm_6a2487087be2492f8b0b165a799f12d3/setup.py", line 111, in <module>
        setup(
      File "/Users/marc/Desktop/hops_test/venv/lib/python3.10/site-packages/setuptools/__init__.py", line 159, in setup
        return distutils.core.setup(**attrs)
      File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/Users/marc/Desktop/hops_test/venv/lib/python3.10/site-packages/setuptools/command/install.py", line 68, in run
        return orig.install.run(self)
      File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/command/install.py", line 568, in run
        self.run_command('build')
      File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/private/var/folders/dq/n7fdtfps47s3c21pbw7ybl100000gn/T/pip-install-0dpp74q5/rhino3dm_6a2487087be2492f8b0b165a799f12d3/setup.py", line 34, in run
        raise RuntimeError(
    RuntimeError: CMake must be installed to build the following extensions: rhino3dm._rhino3dm
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/marc/Desktop/hops_test/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/dq/n7fdtfps47s3c21pbw7ybl100000gn/T/pip-install-0dpp74q5/rhino3dm_6a2487087be2492f8b0b165a799f12d3/setup.py'"'"'; __file__='"'"'/private/var/folders/dq/n7fdtfps47s3c21pbw7ybl100000gn/T/pip-install-0dpp74q5/rhino3dm_6a2487087be2492f8b0b165a799f12d3/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/dq/n7fdtfps47s3c21pbw7ybl100000gn/T/pip-record-gu0mcv_e/install-record.txt --single-version-externally-managed --compile --install-headers /Users/marc/Desktop/hops_test/venv/include/site/python3.10/rhino3dm Check the logs for full command output.

We don’t have a 3.10 build of rhino3dm yet. Sorry about that.

LOL, I’ll try again with Python 3.9 tomorrow and a downgraded Hops. It’s late and I’m tired!

I created a new virtualenv with Python 3.9.7 and downgraded to Hops 0.8 and the same error as mentioned above persists:

1. Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'Resthopper.IO.IoResponseSchema' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
Path '', line 1, position 1.

It’s seems to be an issue with the Hops component, because my CPython script that I ran with the Flask debugger active, didn’t display any errors during the process?

Btw, both ghhops_server and its rhino3dm dependency install fine in CPython 3.9.7.

Try setting your flask app debug mode on. I’m hoping this will show the json that is being returned to Hops so we can figure out what it is that hops is improperly trying to deserialize.

As mentioned in my previous post I ran Flask in debug mode!

Oh, this is failing while trying to get the metadata that describes how a component should be laid out.

While all of this is running, open your browser and paste in the path that you are using for the component. We may be able to see what the json is there that is being returned

I mistook having a debugger active and setting app.debug=True as two different things. Sorry

No worries!

I’ll try to repeat this on my Mac. Andy recently joined the company and is still in progress with getting set up with a Mac.

1 Like

Thanks for looking into it.

Any news?

I updated my Mac to Monterey and am having issues just getting ghhops_server running. I think this is something wrong on my side, but this is taking longer to debug than I had hoped.

OK, thanks for update. I’m still on Big Sur though.

It looks like AirTunes was listening on port 5000. Switching to 5001 does work now. I do see the ghhops_server returning an array of one item which it shouldn’t be doing.

[edit] - I take that back, I’m not seeing the array being returned. I was looking at the incorrect endpoint

What is the path that you are entering for your component? I’ll try to use the exact same path

I didn’t enter a path! I entered a the server address: http://127.0.0.1:5000/