Can't install the ghhops-server module: rhino3dm has an invalid wheel

(venv) PS D:\Python\Test> D:\Python\Test\venv\Scripts\activate.bat
(venv) PS D:\Python\Test> pip install ghhops_server
Collecting ghhops_server
  Using cached ghhops_server-1.5.4-py2.py3-none-any.whl (11 kB)
Collecting rhino3dm
  Using cached rhino3dm-8.0.0-cp39-cp39-win_amd64.whl (2.3 MB)
ERROR: rhino3dm has an invalid wheel, rhino3dm has an invalid wheel, .dist-info directory not found

This goes along with my other topic where my hops simply doesn’t work with flask for some reason:

What’s going on?

Thanks,
Lev

Can you try this again? I pushed the whl with the incorrect directory structure.

I can install it now, thanks, it still creates this problem when trying to use ghhops and flask:

[INFO] Solving using legacy API: <HopsComponent /math [b -> math -> result_path] >
[INFO] 127.0.0.1 - - [22/Mar/2023 18:01:59] "POST /solve HTTP/1.1" 500 -
[ERROR] Error on request:
Traceback (most recent call last):
  File "D:\Python\Test\venv\lib\site-packages\werkzeug\serving.py", line 333, in run_wsgi
    execute(self.server.app)
  File "D:\Python\Test\venv\lib\site-packages\werkzeug\serving.py", line 320, in execute
    application_iter = app(environ, start_response)
  File "D:\Python\Test\venv\lib\site-packages\flask\app.py", line 2551, in __call__
    return self.wsgi_app(environ, start_response)
  File "D:\Python\Test\venv\lib\site-packages\ghhops_server\middlewares\hopsflask.py", line 42, in __call__
    response = self.handle_POST(request)
  File "D:\Python\Test\venv\lib\site-packages\ghhops_server\base.py", line 75, in handle_POST
    res, results = self.solve(uri=uri, payload=data)
  File "D:\Python\Test\venv\lib\site-packages\ghhops_server\base.py", line 126, in solve
    return self._process_solve_request(comp, payload)
  File "D:\Python\Test\venv\lib\site-packages\ghhops_server\base.py", line 192, in _process_solve_request
    res, inputs = self._prepare_inputs(comp, payload)
  File "D:\Python\Test\venv\lib\site-packages\ghhops_server\base.py", line 241, in _prepare_inputs
    value = in_param.from_input(in_param_data)
  File "D:\Python\Test\venv\lib\site-packages\ghhops_server\params.py", line 209, in from_input
    for param_value_item in input_data["InnerTree"]["0"]:
KeyError: '0'

Seems like input_data doesn’t have a value in the ‘0’ position of ["InnerTree"]. Can you try and print input_data to see its structure?

Thanks, please explain if you can - there’s no defined variable called input_data, I made a super simple definition to test:

def math(b):
    if b:
        print(input_data)
        resultmath = 1+2
        return resultmath

The print from inside the definition doesn’t work as it shows me the errors above and again:

[INFO] Solving using legacy API: <HopsComponent /math [b -> math -> result_path] >
[INFO] 127.0.0.1 - - [24/Mar/2023 15:15:56] "POST /solve HTTP/1.1" 500 -
[ERROR] Error on request:
Traceback (most recent call last):
  File "D:\Python\Test\venv\lib\site-packages\werkzeug\serving.py", line 333, in run_wsgi
    execute(self.server.app)
  File "D:\Python\Test\venv\lib\site-packages\werkzeug\serving.py", line 320, in execute
    application_iter = app(environ, start_response)
  File "D:\Python\Test\venv\lib\site-packages\flask\app.py", line 2551, in __call__
    return self.wsgi_app(environ, start_response)
  File "D:\Python\Test\venv\lib\site-packages\ghhops_server\middlewares\hopsflask.py", line 42, in __call__
    response = self.handle_POST(request)
  File "D:\Python\Test\venv\lib\site-packages\ghhops_server\base.py", line 75, in handle_POST
    res, results = self.solve(uri=uri, payload=data)
  File "D:\Python\Test\venv\lib\site-packages\ghhops_server\base.py", line 126, in solve
    return self._process_solve_request(comp, payload)
  File "D:\Python\Test\venv\lib\site-packages\ghhops_server\base.py", line 192, in _process_solve_request
    res, inputs = self._prepare_inputs(comp, payload)
  File "D:\Python\Test\venv\lib\site-packages\ghhops_server\base.py", line 241, in _prepare_inputs
    value = in_param.from_input(in_param_data)
  File "D:\Python\Test\venv\lib\site-packages\ghhops_server\params.py", line 209, in from_input
    for param_value_item in input_data["InnerTree"]["0"]:
KeyError: '0'

Outside the definition it simply gives me a syntax error:

D:\Python\Test\venv\Scripts\python.exe D:\Python\Test\app.py 
  File "D:\Python\Test\app.py", line 25
    print(input_data)
    ^
SyntaxError: invalid syntax

Any updates? I had the exact same error and I don’t know what to do

I deleted Python entirely from my computer, from Path and all, and then reinstalled only one version (Python 3.10), created an entirely new project based on the fresh Python install and that solved it.