Hello! I’m excited at getting my feet wet with Pre...
# prefect-community
Hello! I’m excited at getting my feet wet with Prefect, just installed it locally on macOS, ran
prefect backend server
prefect server start
, got the web UI up and wonder how I can make the standard hello world example below appear in that UI? Do I need a “project”? If so how do I wire that up with the example code running?
Copy code
from prefect import task, Flow, Parameter

def say_hello(name):
    print("Hello, {}!".format(name))

with Flow("My First Flow") as flow:
    name = Parameter('name')

flow.run(name='world') # "Hello, world!" 
flow.run(name='Marvin') # "Hello, Marvin!"
Hey @Dinu Gherman welcome! Yes you will need to create a project for your flow to live and then you will
it to that project. I recommend walking through this deployment tutorial which will outline some of these features 🙂 https://docs.prefect.io/orchestration/tutorial/first.html
Thanks a lot!!
Ok, if I append
to some sample code, I get this error below.
Copy code
ClientError: Malformed response received from Cloud - please ensure that you have an API token properly configured.
But I don’t see a way to create an API token for the local server.
Can you confirm that you ran
prefect backend server
on that same machine? That is an error when attempting to talk to Cloud
Try running
prefect diagnostics
and see the backend set
Definitely, yes.
Can you post the output of the diagnostics command?
Copy code
$ prefect diagnostics
  "config_overrides": {},
  "env_vars": [],
  "system_information": {
    "platform": "Darwin-18.7.0-x86_64-i386-64bit",
    "prefect_backend": "server",
    "prefect_version": "0.13.6",
    "python_version": "3.7.6"
Interesting 🤔 and this is in the same terminal session that you are running the script that has the register call?
Nope, I’m running the code in a Jupyer notebook running in the same conda environment.
Started in a different terminal.
In the notebook can you try this:
Copy code
from prefect import config
Says “cloud”.
Yeah so wherever that notebook is running it is not respecting the
prefect backend server
If the notebook has a terminal or something you could call it there
Hmm, have set it in a terminal inside Jupyter as well as in a cell. No change. Let me restart Jupyter…
Still no luck from Jupyter, but I could run it from a terminal IPython session! After running
I still had to run the flow in the UI manually, which came up with unenxpected strings like “nickel-roadrunner” 😉 I guess there is some way to start the entire flow from code, too…