Shivam Bhatia
07/05/2022, 5:42 AM$ # start python REPL with native await functionality
$ python -m asyncio
>>> from prefect.client import get_client
>>> async with get_client() as client:
... response = await client.hello()
... print(response.json())
š
and I got this error:
Traceback (most recent call last):
File "/usr/lib/python3.9/concurrent/futures/_base.py", line 440, in result
return self.__get_result()
File "/usr/lib/python3.9/concurrent/futures/_base.py", line 389, in __get_result
raise self._exception
File "<console>", line 1, in <module>
File "/home/shivam/.local/lib/python3.9/site-packages/prefect/client.py", line 111, in get_client
ctx = prefect.context.get_settings_context()
File "/home/shivam/.local/lib/python3.9/site-packages/prefect/context.py", line 272, in get_settings_context
raise MissingContextError("No settings context found.")
prefect.exceptions.MissingContextError: No settings context found.
Am I missing something in the setup?Mathijs Carlu
07/05/2022, 7:24 AMprefect config set PREFECT_API_URL="http://<external-ip>:4200/api"
?Shivam Bhatia
07/05/2022, 7:27 AMMathijs Carlu
07/05/2022, 7:28 AMprefect config view
?Shivam Bhatia
07/05/2022, 7:31 AMPREFECT_PROFILE='default'
PREFECT_API_URL='http://<external-ip>:4200/api' (from profile)
Mathijs Carlu
07/05/2022, 7:47 AMget_client()
, you could use OrionClient('http://<external-ip>:4200/api')
. This seems to work on my machineAnna Geller
07/05/2022, 11:02 AMMathijs Carlu
07/05/2022, 11:16 AMpython -m asyncio
from the terminal. I was able to recreate on both windows and linuxAnna Geller
07/05/2022, 11:20 AM