You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which was the only way I could get the python project to run. None of the examples that I have seen require the PYTHONPATH to be set, however if I do not set it, I get the following error in the Aspire CONSOLE log.
ModuleNotFoundError: No module named 'opentelemetry'
Traceback (most recent call last):
File "/home/eholton/.pyenv/versions/3.10.4/bin/uvicorn", line 8, in <module>
sys.exit(main())
File "/home/eholton/.pyenv/versions/3.10.4/lib/python3.10/site-packages/click/core.py", line 1157, in _call_
return self.main(*args, **kwargs)
File "/home/eholton/.pyenv/versions/3.10.4/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/home/eholton/.pyenv/versions/3.10.4/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/eholton/.pyenv/versions/3.10.4/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/home/eholton/.pyenv/versions/3.10.4/lib/python3.10/site-packages/uvicorn/main.py", line 410, in main
run(
File "/home/eholton/.pyenv/versions/3.10.4/lib/python3.10/site-packages/uvicorn/main.py", line 577, in run
server.run()
File "/home/eholton/.pyenv/versions/3.10.4/lib/python3.10/site-packages/uvicorn/server.py", line 65, in run
return asyncio.run(self.serve(sockets=sockets))
File "/home/eholton/.pyenv/versions/3.10.4/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
File "/home/eholton/.pyenv/versions/3.10.4/lib/python3.10/site-packages/uvicorn/server.py", line 69, in serve
await self._serve(sockets)
File "/home/eholton/.pyenv/versions/3.10.4/lib/python3.10/site-packages/uvicorn/server.py", line 76, in _serve
config.load()
File "/home/eholton/.pyenv/versions/3.10.4/lib/python3.10/site-packages/uvicorn/config.py", line 434, in load
self.loaded_app = import_from_string(self.app)
File "/home/eholton/.pyenv/versions/3.10.4/lib/python3.10/site-packages/uvicorn/importer.py", line 22, in import_from_string
raise exc from None
File "/home/eholton/.pyenv/versions/3.10.4/lib/python3.10/site-packages/uvicorn/importer.py", line 19, in import_from_string
module = importlib.import_module(module_str)
File "/home/eholton/.pyenv/versions/3.10.4/lib/python3.10/importlib/_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/eholton/code/work/SharedComponents/document-service-code/src/python/triage/src/main.py", line 10, in <module>
from common.Models.Events.StartTriage import StartTriage
ModuleNotFoundError: No module named 'common'
if I run the command locally .venv/bin/opentelemetry-instrument --traces_exporter otlp --logs_exporter console,otlp --metrics_exporter otlp uvicorn src.main:app, I get the same error
If I run the command with poetry run .venv/bin/opentelemetry-instrument --traces_exporter otlp --logs_exporter console,otlp --metrics_exporter otlp uvicorn src.main:app, it works.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Environment: Python 3.10, .NET 8.0, Windows using WSL Ubuntu 24.04.1
To start with I am a python newbie, only done simple scripts in the past.
I have the following code in my
Program.cs
filewhich was the only way I could get the python project to run. None of the examples that I have seen require the
PYTHONPATH
to be set, however if I do not set it, I get the following error in the Aspire CONSOLE log.if I run the command locally
.venv/bin/opentelemetry-instrument --traces_exporter otlp --logs_exporter console,otlp --metrics_exporter otlp uvicorn src.main:app
, I get the same errorIf I run the command with
poetry run .venv/bin/opentelemetry-instrument --traces_exporter otlp --logs_exporter console,otlp --metrics_exporter otlp uvicorn src.main:app
, it works.What am I doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions