deta / space-cli

Deta Space CLI

Home Page:https://deta.space

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No module named 'main' when try to push h2o.ai wave app using `space push`

pira998 opened this issue · comments

I have three files app.py, requirements.txt, SpaceFile
1 . app.py

from h2o_wave import main, app, Q, ui


@app('/')
async def serve(q: Q):
    if q.args.info_card:
        q.page['example'] = ui.form_card(box='1 1 2 4', items=[
            ui.button(name='back', label='Go back', primary=True),
        ])
    else:
        q.page['example'] = ui.tall_info_card(
            box='1 1 2 5',
            name='info_card',
            title='Info Card',
            caption='Lorem ipsum dolor sit amet consectetur adipisicing elit.',
            category='Category',
            label='Click me',
            image='https://images.pexels.com/photos/3225517/pexels-photo-3225517.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260',
        )

    await q.page.save()
  1. requirements.txt
h2o-wave==0.26.0
  1. .SpaceFile
# Spacefile Docs: https://go.deta.dev/docs/spacefile/v0
v: 0
micros:
  - name: SpaceApp
    src: ./
    engine: python3.9
    primary: true
    dev: venv/bin/wave run app

space dev is running fine.

Screenshot 2023-08-13 at 13 52 51

when I run space push, pushed successfully.
output.log

✓ Successfully pushed your code and updated your Builder instance!

But If i open the url https://llmappstudio-1-g3961636.deta.app, It gives this error

Error Type:
ModuleNotFoundError

Error Message:
No module named 'main'

Logs:
time="2023-08-13T08:28:10Z" level=info msg="serving logs listener on sandbox.localdomain:1234" agent=logsApiAgent
TELEMETRY	Name: telemetry-extension	State: Subscribed	Types: [Function]
Stack Trace:
  File "/opt/python/detalib/debugger.py", line 131, in wrap
    return func(event, context)

  File "/var/task/_entry.py", line 12, in handler
    import main  # noqa

Could you please help with this?

hi this is not an issue with the cli. please use our discord for help: https://go.deta.dev/discord