posit-dev / py-shinylive

Python package for deploying Shinylive applications
https://shiny.posit.co/py/docs/shinylive.html
MIT License
44 stars 5 forks source link

Error copying packages to `site/shinylive/pyodide/` #1

Closed mattsecrest closed 2 years ago

mattsecrest commented 2 years ago

Hi there,

I was trying out shinylive on a virtualenv on 3.9.14 and could not get it to work:

pip install shiny

pip install shinylive

shiny create myapp

shinylive export myapp site

Creating site/
Copying base Shinylive files from /Users/XX/Library/Caches/shinylive/shinylive-0.0.8/ to site/
Copying imported packages from /Users/XX/Library/Caches/shinylive/shinylive-0.0.8/shinylive/pyodide/ to site/shinylive/pyodide/
Traceback (most recent call last):
  File "/usr/local/bin/shinylive", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/shinylive/_main.py", line 79, in export
    _export.export(
  File "/usr/local/lib/python3.9/site-packages/shinylive/_export.py", line 101, in export
    copy_fn(src_path, dest_path)
  File "/usr/local/lib/python3.9/site-packages/shinylive/_utils.py", line 93, in copy_fn
    verbose_print(f"Skipping {dst}", file=sys.stderr)
TypeError: verbose_print() got an unexpected keyword argument 'file'

Any idea what might be going on? Really looking forward to playing around with this!

wch commented 2 years ago

Thanks for the bug report! I've fixed it and will make a new release soon.

wch commented 2 years ago

The new version is on PyPI -- please try it out!

mattsecrest commented 2 years ago

Thanks, @wch . It actually still does not work for me after updating, but it may be on my end. I've tried on a few different python versions and in and out of virtual environments and no vail. Any idea what the problem could be?

wch commented 2 years ago

@mattsecrest When you run shinylive from the terminal, what versions does it print out?

It should show:

$ shinylive
Usage: shinylive [OPTIONS] COMMAND [ARGS]...

  shinylive Python package version: 0.0.7
  shinylive web assets version:     0.0.10
mattsecrest commented 1 year ago

Huh, yeah I see the below:

Usage: shinylive [OPTIONS] COMMAND [ARGS]...

  shinylive Python package version: 0.0.4
  shinylive web assets version:     0.0.8

I tried updating many times, eg:

pip install shinylive== 0.0.7 to no avail

wch commented 1 year ago

To install a specific version, you should run the following (note that there's no space after the ==):

pip install shinylive==0.0.7

Or, to just get the latest, you can do:

pip install shinylive --upgrade
mattsecrest commented 1 year ago

Thanks, @wch . This was an issue on my end that apparently relates to homebrew? I got it with python -m pip install shinylive==0.0.7, but pip install shinylive==0.0.7 does not work.