https://prefect.io logo
Title
n

Navin Chaganti

09/30/2022, 8:22 PM
ents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/Users/navinchaganti/codebase/prefect-dev/prefect_env/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -c asyncpg/pgproto/pgproto.c -o build/temp.macosx-10.9-universal2-cpython-39/asyncpg/pgproto/pgproto.o -O2 -fsigned-char -Wall -Wsign-compare -Wconversion
  asyncpg/pgproto/pgproto.c:31:10: fatal error: 'Python.h' file not found
  #include "Python.h"
           ^~~~~~~~~~
  1 error generated.
  error: command '/usr/bin/clang' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for asyncpg
Failed to build asyncpg
ERROR: Could not build wheels for asyncpg which use PEP 517 and cannot be installed directly
Anyone faced the asyncpg error while installation ?
2
z

Zanie

09/30/2022, 8:24 PM
Interesting! They just added arm64 wheels so you don’t have to build locally: https://github.com/MagicStack/asyncpg/pull/954
1
Otherwise it looks like you’re missing the Python build headers. What OS are you on?
n

Navin Chaganti

09/30/2022, 8:29 PM
macbook
Monterey
12.6
I am using the default python by apple, do I need to change my python ?
z

Zanie

09/30/2022, 8:30 PM
I’d recommend using miniconda, we use that internally and it makes working with the database backends much easier.
💯 1
n

Navin Chaganti

09/30/2022, 10:14 PM
Found flow 'Bigquery flow'
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.10/site-packages/prefect/client/orion.py", line 1083, in read_block_document_by_name
    response = await self._client.get(
  File "/opt/homebrew/lib/python3.10/site-packages/httpx/_client.py", line 1751, in get
    return await self.request(
  File "/opt/homebrew/lib/python3.10/site-packages/httpx/_client.py", line 1527, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/opt/homebrew/lib/python3.10/site-packages/prefect/client/base.py", line 182, in send
    response.raise_for_status()
  File "/opt/homebrew/lib/python3.10/site-packages/prefect/client/base.py", line 125, in raise_for_status
    raise PrefectHTTPStatusError.from_httpx_error(exc) from exc.__cause__
prefect.exceptions.PrefectHTTPStatusError: Client error '404 Not Found' for url '<http://ephemeral-orion/api/block_types/slug/gcs/block_documents/name/qa?include_secrets=true>'
Response: {'detail': 'Block document not found'}
For more information check: <https://httpstatuses.com/404>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.10/site-packages/prefect/blocks/core.py", line 648, in load
    block_document = await client.read_block_document_by_name(
  File "/opt/homebrew/lib/python3.10/site-packages/prefect/client/orion.py", line 1089, in read_block_document_by_name
    raise prefect.exceptions.ObjectNotFound(http_exc=e) from e
prefect.exceptions.ObjectNotFound

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.10/site-packages/prefect/cli/_utilities.py", line 41, in wrapper
    return fn(*args, **kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 212, in wrapper
    return run_async_in_new_loop(async_fn, *args, **kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 141, in run_async_in_new_loop
    return anyio.run(partial(__fn, *args, **kwargs))
  File "/opt/homebrew/lib/python3.10/site-packages/anyio/_core/_eventloop.py", line 70, in run
    return asynclib.run(func, *args, **backend_options)
  File "/opt/homebrew/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 292, in run
    return native_run(wrapper(), debug=debug)
  File "/opt/homebrew/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/opt/homebrew/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/opt/homebrew/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 287, in wrapper
    return await func(*args)
  File "/opt/homebrew/lib/python3.10/site-packages/prefect/cli/deployment.py", line 661, in build
    storage = await Block.load(storage_block)
  File "/opt/homebrew/lib/python3.10/site-packages/prefect/client/orion.py", line 82, in with_injected_client
    return await fn(*args, **kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/prefect/blocks/core.py", line 652, in load
    raise ValueError(
ValueError: Unable to find block document named qa for block type gcs
now I am getting a error not able to read the gcs block
what is the account used to run the job locally? Am I missing some permissions? Thanks!
m

Marco Pérez

10/17/2022, 10:00 PM
dang - hate to ask a dumb question here - but I’m coming across the same error here. What is strange to me is that I was able to install prefect 2.0 when it was in beta. But now I’m getting this same error
In file included from src/greenlet/greenlet.c:11:
      src/greenlet/greenlet.h:8:10: fatal error: 'Python.h' file not found
      #include <Python.h>
               ^~~~~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for greenlet
1
Some other potentially informative error lines:
Building wheel for asyncpg (pyproject.toml) did not run successfully.
...
python setup.py bdist_wheel did not run successfully.
I tried installing different versions of prefect but get the same issue - even the pre-release versions which used to work for me.
z

Zanie

10/17/2022, 10:28 PM
I think the recommendation above re. Python headers or using Conda still stands.
m

Marco Pérez

10/17/2022, 10:28 PM
hm .. no idea what that is - I’ll go-a-hunting - but recommendations/direction would be helpful.
interesting that I’m able to install on our ec2 server w/o any issues.
z

Zanie

10/17/2022, 10:29 PM
The EC2 server likely has an architecture with prebuilt versions of the package available
Your architecture does not, so it is attempting to build, but some requirements are missing.
The stackoverflow post above explains how to install headers
Alternatively, you can just use miniconda and it should take care of it
m

Marco Pérez

10/17/2022, 10:31 PM
miniconda would be used in place of pipenv?
z

Zanie

10/17/2022, 10:57 PM
Yep!
m

Marco Pérez

10/19/2022, 5:45 AM
Miniconda #ftw 🥲 🙃 :melting_face:
Thanks!