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

How to use uvicorn and streamlit in a UV environment? #12267

Open
dyuzhou opened this issue Mar 18, 2025 · 4 comments
Open

How to use uvicorn and streamlit in a UV environment? #12267

dyuzhou opened this issue Mar 18, 2025 · 4 comments
Labels
external The problem is with another package or dependency (not uv) needs-mre Needs more information for reproduction

Comments

@dyuzhou
Copy link

dyuzhou commented Mar 18, 2025

Summary

I use uvicorn and streamlit in my project. The command is started normally when using the caonda environment. However, the following error is thrown when using UV. I don't know if it is a problem with my usage or something else? How should I use uv run uvicorn app:app --workers 2?

Magic number 'UVSC' or 'UVPY' not found at the end of the file. Did you append the magic number, the length and the path to the python executable at the end of the file?

Platform

Windows 11 X86

Version

uv 0.6.2

Python version

Python 3.10

@dyuzhou dyuzhou added the bug Something isn't working label Mar 18, 2025
@samypr100
Copy link
Collaborator

I tried it out and I can run uvicorn fine on windows, can you share the command steps by step that led you there?

@konstin konstin added needs-mre Needs more information for reproduction and removed bug Something isn't working labels Mar 19, 2025
@johannesloibl
Copy link

We got the same error but in a Hatch context (Hatch v1.14.0):

Image

FYI @ofek

@ofek
Copy link
Contributor

ofek commented Mar 27, 2025

Can't help without a reproducible example.

@johannesloibl
Copy link

johannesloibl commented Mar 27, 2025

Can't help without a reproducible example.

Sry this is also not reproducible on my PC but only occurring for a colleague. I hoped you were maybe seeing this error message somewhere in the code, but i expect it has nothing to to with Hatch, just wanted you to be aware.

Weirdly calling hatch build has no problem, but running it through a hatch script

Image named "publish" it fails on hatch build.

@zanieb zanieb added the external The problem is with another package or dependency (not uv) label Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external The problem is with another package or dependency (not uv) needs-mre Needs more information for reproduction
Projects
None yet
Development

No branches or pull requests

6 participants