# prefect-community


06/29/2022, 9:42 AM
Hi. I’m trying Prefect Orion. I tried to start Prefect Server using the Prefect Python API, but got an error. Anyone have any idea what the cause might be? I would be glad to know. I’m using Prefect 2.0b7.
Copy code
from prefect.cli import orion

# Start Orion server.

async def start_orion_server() -> None:
    await orion.start()

    print("Succeed starting Prefect Orion Server.")

Copy code
Traceback (most recent call last):
  File "/********/********/PyCharmProjects/********/workflows/", line 233, in <module>
  File "/********/********/PyCharmProjects/********/workflows/", line 69, in initialize
  File "/********/********/.pyenv/versions/3.9.1/lib/python3.9/asyncio/", line 44, in run
    return loop.run_until_complete(main)
  File "/********/********/.pyenv/versions/3.9.1/lib/python3.9/asyncio/", line 642, in run_until_complete
    return future.result()
  File "/********/********/PyCharmProjects/********/workflows/", line 196, in start_orion_server
    await orion.start()
  File "/********/********/Library/Caches/pypoetry/virtualenvs/********-py3.9/lib/python3.9/site-packages/prefect/cli/", line 120, in start
    await tg.start(
  File "/********/********/Library/Caches/pypoetry/virtualenvs/********-py3.9/lib/python3.9/site-packages/anyio/_backends/", line 807, in start
    return await future
  File "/********/********/Library/Caches/pypoetry/virtualenvs/********-py3.9/lib/python3.9/site-packages/prefect/cli/", line 77, in open_process_and_stream_output
    process = await anyio.open_process(
  File "/********/********/Library/Caches/pypoetry/virtualenvs/********-py3.9/lib/python3.9/site-packages/anyio/_core/", line 127, in open_process
    return await get_asynclib().open_process(
  File "/********/********/Library/Caches/pypoetry/virtualenvs/********-py3.9/lib/python3.9/site-packages/anyio/_backends/", line 1105, in open_process
    process = await asyncio.create_subprocess_exec(
  File "/********/********/.pyenv/versions/3.9.1/lib/python3.9/asyncio/", line 236, in create_subprocess_exec
    transport, protocol = await loop.subprocess_exec(
  File "/********/********/.pyenv/versions/3.9.1/lib/python3.9/asyncio/", line 1661, in subprocess_exec
    transport = await self._make_subprocess_transport(
  File "/********/********/.pyenv/versions/3.9.1/lib/python3.9/asyncio/", line 197, in _make_subprocess_transport
    transp = _UnixSubprocessTransport(self, protocol, args, shell,
  File "/********/********/.pyenv/versions/3.9.1/lib/python3.9/asyncio/", line 36, in __init__
    self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
  File "/********/********/.pyenv/versions/3.9.1/lib/python3.9/asyncio/", line 789, in _start
    self._proc = subprocess.Popen(
  File "/********/********/.pyenv/versions/3.9.1/lib/python3.9/", line 947, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/********/********/.pyenv/versions/3.9.1/lib/python3.9/", line 1739, in _execute_child
    env_list.append(k + b'=' + os.fsencode(v))
  File "/********/********/.pyenv/versions/3.9.1/lib/python3.9/", line 810, in fsencode
    filename = fspath(filename)  # Does type-checking of `filename`.
TypeError: expected str, bytes or os.PathLike object, not OptionInfo

James Sopkin

06/29/2022, 2:08 PM
Hi Masato, the orion.start method requires for some parameters to be passed in such as host, port, scheduler etc, otherwise default values specified in settings will be used
I think it's expecting one of those parameters but is only receiving an


06/30/2022, 5:19 PM
Hi, James. Thank you very much for your answer! I was able to resolve the error successfully. Your advice helped me a lot.