We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Trying to launch a python service from Aspire using AddUvicornApp(), the launch fails with:
AddUvicornApp()
ModuleNotFoundError: No module named 'redis'
When I launch the python service manually, using poetry run uvicorn app.main:app everything works fine instead.
poetry run uvicorn app.main:app
I found that the different behavior is because AddUvicornApp uses uvicorn (and python) from the host, rather than the one inside .venv:
AddUvicornApp
uvicorn
.venv
Manual => poetry run uvicorn app.main:app => Ok AddUvicornApp => uvicorn app.main:app => Fail
uvicorn app.main:app
Could you change the implementation to allow using uvicorn from the virtual env (.venv dir)?
No response
Create app with Poetry, add a dependency missing in the host, integrate the service using `AddUvicornApp`. The app crashes.
AddUvicornApp should leverage uvicorn from the app .venv folder
Other
CLI
Aspire.Hosting.AppHost 9.1.0 CommunityToolkit.Aspire.Hosting.Python.Extensions 9.2.1
No, just wanted to report this
The text was updated successfully, but these errors were encountered:
This change to private ... AddUvicornApp(...) method should be sufficient:
private ... AddUvicornApp(...)
From:
var instrumentationExecutable = virtualEnvironment.GetExecutable("opentelemetry-instrument"); var projectExecutable = instrumentationExecutable ?? "uvicorn";
To:
var instrumentationExecutable = virtualEnvironment.GetExecutable("opentelemetry-instrument"); var uvicornExecutable = virtualEnvironment.GetExecutable("uvicorn") ?? "uvicorn"; var projectExecutable = instrumentationExecutable ?? uvicornExecutable;
Sorry, something went wrong.
Use “uvicorn” from .venv if available
7620dbd
Addresses CommunityToolkit#545
Successfully merging a pull request may close this issue.
Describe the bug
Trying to launch a python service from Aspire using
AddUvicornApp()
, the launch fails with:When I launch the python service manually, using
poetry run uvicorn app.main:app
everything works fine instead.I found that the different behavior is because
AddUvicornApp
usesuvicorn
(and python) from the host, rather than the one inside.venv
:Manual =>
poetry run uvicorn app.main:app
=> OkAddUvicornApp =>
uvicorn app.main:app
=> FailCould you change the implementation to allow using uvicorn from the virtual env (.venv dir)?
Regression
No response
Steps to reproduce
Expected behavior
AddUvicornApp
should leverage uvicorn from the app .venv folderScreenshots
No response
IDE and version
Other
IDE version
CLI
Nuget packages
Additional context
No response
Help us help you
No, just wanted to report this
The text was updated successfully, but these errors were encountered: