Skip to content

Require requirements.txt file #538

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

Open
gshotwell opened this issue Jan 22, 2024 · 1 comment · May be fixed by #680
Open

Require requirements.txt file #538

gshotwell opened this issue Jan 22, 2024 · 1 comment · May be fixed by #680

Comments

@gshotwell
Copy link

Currently the package generates a requirements.txt file automatically as part of the deployment process which causes a lot of problems for neophite users. A few observations from supporting lots of python users through this process:

  1. Virtual environments are essential to python deployments
    When people try to deploy to either Connect or Shinyapps without a virtual environment they have a horrible time, and get really bewildering failures after long deploy jobs. I have never seen a real user have a good time with our products without using a virtual environment.

  2. People who use virtual environments likely also use requirements.txt files
    As a result it's not a burden for these users to be required to either do their own pip freeze or maintain their own requirments file, and generating it automatically doesn't help them

  3. People who don't know about requirements.txt files are likely not using a virtual environment. These people seem to benefit from the automatic file generation, but it's actually just making their error worse and more obscure. In particular:

  • Their system python is likely a mess so pip freeze will generate an unsolvable environment and a deployment failure. The error they get back doesn't help them, and it only occurs after Connect or Shinyapps have spent a long time trying to install things
  • Locking things down to particular package versions is too restrictive and also creates errors
  • OS-specific packaages like pywin are not installable on Linux servers, but are generated by pip freeze

As a result I think we should cancel the autogeneration and require the requirements.txt file. This is what Streamlit and HuggingFace require.

@jimhester
Copy link

I agree with this, I think it would be more clear for users if an explicit requirements.txt was always required.

We often have users trying to deploy content to Connect either forget to include the requirements.txt, or have it in a different directory than needed for Posit Connect to pick up. Then their deploy ends up failing with an obscure error they don't understand, and we have to help them debug the issue.

If deploys failed with a helpful error message more users would be able to self-serve these deploy issue.

@jonkeane jonkeane linked a pull request Jun 9, 2025 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants