Hi all, just getting started with Prefect and I'm ...
# ask-community
c
Hi all, just getting started with Prefect and I'm stuck on error: ValueError: No Prefect API URL provided. Please set PREFECT_API_URL to the address of a running Prefect server. prefect version = 3.1.1 I've confirmed the server is running at http://127.0.0.1:4200 I've updated pyproject.toml with
Copy code
#  pyproject.tom

[tool.prefect]
logging.level = "DEBUG"
api.url = "<http://127.0.0.1:4200/api>"
Any guidance is appreciated
n
hi @CJ - welcome! what does
prefect config view
say?
c
Hi Nate and thanks for the quick response. prefect config view PREFECT_PROFILE='local' PREFECT_API_URL='http://127.0.0.1:4200/api' (from profile) (mainstream-dw-py3.10) PS C:\Users\cjones\Documents\vs_code\mti-datawarehouse\mainstream_dw\pip
n
did you happen to set the settings in your
toml
file after you ran
prefect server start
?
c
I did but I've shut down and restarted after
n
hrm ok sorry where are you seeing this error?
Copy code
ValueError: No Prefect API URL provided. Please set PREFECT_API_URL to the address of a running Prefect server.
c
when I run
python main.py
Copy code
# main.py


if __name__ == "__main__":
    run_pipeline.serve(name="initial-deployment", cron="*/3 * * * *")
n
hrm thats odd can you add this above your serve call
Copy code
from prefect.settings import Settings
print(Settings().api)
c
Tested with entering prefect config set PREFECT_API_URL="http://127.0.0.1:4200/api" and it runs w/out error. SETTINGS: url='http://127.0.0.1:4200/api' key=None tls_insecure_skip_verify=False ssl_cert_file=None enable_http2=False r equest_timeout=60.0 Your flow 'run-pipeline' is being served and polling for scheduled runs!
n
hmm ok this might be a problem with us respecting the
pyproject.toml
settings source if you dont mind checking, does it work if you set it in
.env
?
c
same format?
Copy code
api.url = "<http://127.0.0.1:4200/api>"
or PREFECT_API_URL="http://127.0.0.1:4200/api"
n
the latter
c
that works
n
ok sweet, would you be willing to open an issue about the pyproject.toml settings source not being respected? otherwise I can later
c
Will do, thanks for the guidance