Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shiny create requires requests python package #935

Closed
dskard opened this issue Dec 22, 2023 · 2 comments · Fixed by #940
Closed

shiny create requires requests python package #935

dskard opened this issue Dec 22, 2023 · 2 comments · Fixed by #940

Comments

@dskard
Copy link

dskard commented Dec 22, 2023

Release 0.6.1 introduced a dependency on the requests package. When I try to use shiny create without having previously installed the requests package, the command fails:

$ python -m venv venv
$ . ./venv/bin/activate
$ pip install shiny
Collecting shiny
  Using cached shiny-0.6.1-py3-none-any.whl (3.3 MB)
...
Successfully installed anyio-4.2.0 appdirs-1.4.4 asgiref-3.7.2 click-8.1.7 exceptiongroup-1.2.0 h11-0.14.0 htmltools-0.5.1 idna-3.6 linkify-it-py-2.0.2 markdown-it-py-3.0.0 mdit-py-plugins-0.4.0 mdurl-0.1.2 packaging-23.2 prompt_toolkit-3.0.36 python-multipart-0.0.6 questionary-2.0.1 shiny-0.6.1 sniffio-1.3.0 starlette-0.34.0 typing-extensions-4.9.0 uc-micro-py-1.0.2 uvicorn-0.25.0 watchfiles-0.21.0 wcwidth-0.2.12 websockets-12.0
$ shiny create -t basic-app -m core
Traceback (most recent call last):
  File "/home/user/shiny_create_no_requests/venv/bin/shiny", line 8, in <module>
    sys.exit(main())
  File "/home/user/shiny_create_no_requests/venv/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/user/shiny_create_no_requests/venv/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/user/shiny_create_no_requests/venv/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/user/shiny_create_no_requests/venv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/user/shiny_create_no_requests/venv/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/user/shiny_create_no_requests/venv/lib/python3.10/site-packages/shiny/_main.py", line 521, in create
    from ._template_utils import template_query, use_git_template
  File "/home/user/shiny_create_no_requests/venv/lib/python3.10/site-packages/shiny/_template_utils.py", line 11, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'

Can the requests package be listed as a dependency so it gets installed automatically when shiny gets installed?

@wch
Copy link
Collaborator

wch commented Dec 22, 2023

Thanks for finding this.

I think it would make sense to switch to the urllib library, since that one is part of the standard library, and we only use requests.get() in one place.

@wch
Copy link
Collaborator

wch commented Dec 22, 2023

This has been fixed in v0.6.1.1, which has been merged into main.

@wch wch closed this as completed Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants