Error running PyAirbyte example script with Python 3.10

Summary

The user is encountering an error when trying to run the PyAirbyte example script with Python 3.10, specifically related to an unknown type ‘typing.Optional[str]’. They also mention having issues installing numpy with a different Python version.


Question

i have python 3.10 and when trying to run this program https://github.com/airbytehq/PyAirbyte/blob/main/examples/run_faker.py getting following error .
PS C:\code\pocs\pyairbyte-git\PyAirbyte> poetry run python ./examples/run_faker.py
C:\code\pocs\pyairbyte-git\PyAirbyte.venv\lib\site-packages\snowflake\sqlalchemy\base.py:1068: SAWarning: The GenericFunction ‘flatten’ is already registered and is going to be overridden.
functions.register_function(“flatten”, flatten)
Traceback (most recent call last):
File “C:\code\pocs\pyairbyte-git\PyAirbyte\examples\run_faker.py”, line 13, in <module>
import airbyte as ab
File “C:\code\pocs\pyairbyte-git\PyAirbyte\airbyte_init_.py”, line 126, in <module>
from airbyte import (
File “C:\code\pocs\pyairbyte-git\PyAirbyte\airbyte\cloud_init_.py”, line 59, in <module>
from airbyte.cloud import connections, constants, sync_results, workspaces
File “C:\code\pocs\pyairbyte-git\PyAirbyte\airbyte\cloud\workspaces.py”, line 27, in <module>
from airbyte.sources.base import Source
File “C:\code\pocs\pyairbyte-git\PyAirbyte\airbyte\sources_init_.py”, line 6, in <module>
from airbyte.sources import base, util
File “C:\code\pocs\pyairbyte-git\PyAirbyte\airbyte\sources\util.py”, line 10, in <module>
from airbyte.executors.util import get_connector_executor
File “C:\code\pocs\pyairbyte-git\PyAirbyte\airbyte_executors\util.py”, line 13, in <module>
from airbyte.executors.declarative import DeclarativeExecutor
File “C:\code\pocs\pyairbyte-git\PyAirbyte\airbyte_executors\declarative.py”, line 13, in <module>
from airbyte_cdk.entrypoint import AirbyteEntrypoint
File "C:\code\pocs\pyairbyte-git\PyAirbyte.venv\lib\site-packages\airbyte_cdk_init
.py", line 7, in <module>
from .destinations import Destination
File "C:\code\pocs\pyairbyte-git\PyAirbyte.venv\lib\site-packages\airbyte_cdk\destinations_init
.py", line 5, in <module>
from .destination import Destination
File “C:\code\pocs\pyairbyte-git\PyAirbyte.venv\lib\site-packages\airbyte_cdk\destinations\destination.py”, line 12, in <module>
from airbyte_cdk.connector import Connector
File “C:\code\pocs\pyairbyte-git\PyAirbyte.venv\lib\site-packages\airbyte_cdk\connector.py”, line 14, in <module>
from airbyte_cdk.models import AirbyteConnectionStatus, ConnectorSpecification, ConnectorSpecificationSerializer
File “C:\code\pocs\pyairbyte-git\PyAirbyte.venv\lib\site-packages\airbyte_cdk\models_init_.py”, line 63, in <module>
from .airbyte_protocol_serializers import (
File “C:\code\pocs\pyairbyte-git\PyAirbyte.venv\lib\site-packages\airbyte_cdk\models\airbyte_protocol_serializers.py”, line 33, in <module>
AirbyteStreamStateSerializer = Serializer(AirbyteStreamState, omit_none=True, custom_type_resolver=custom_type_resolver)
File “C:\code\pocs\pyairbyte-git\PyAirbyte.venv\lib\site-packages\serpyco_rs_main.py”, line 63, in init
self._type_info = describe_type(t, custom_type_resolver=custom_type_resolver)
File “C:\code\pocs\pyairbyte-git\PyAirbyte.venv\lib\site-packages\serpyco_rs_describe.py”, line 244, in describe_type
entity_type = _describe_entity(
File “C:\code\pocs\pyairbyte-git\PyAirbyte.venv\lib\site-packages\serpyco_rs_describe.py”, line 343, in describe_entity
field_type = describe_type(type
, meta, custom_type_resolver)
File “C:\code\pocs\pyairbyte-git\PyAirbyte.venv\lib\site-packages\serpyco_rs_describe.py”, line 244, in describe_type
entity_type = _describe_entity(
File “C:\code\pocs\pyairbyte-git\PyAirbyte.venv\lib\site-packages\serpyco_rs_describe.py”, line 343, in describe_entity
field_type = describe_type(type
, meta, custom_type_resolver)
File “C:\code\pocs\pyairbyte-git\PyAirbyte.venv\lib\site-packages\serpyco_rs_describe.py”, line 303, in describe_type
raise RuntimeError(f’Unknown type {t!r}')
RuntimeError: Unknown type typing.Optional[str]

when using other version of python not able to install numpy itself . any suggestions



This topic has been created from a Slack thread to give it more visibility.
It will be on Read-Only mode here. Click here if you want
to access the original thread.

Join the conversation on Slack

["error", "pyairbyte", "python-3.10", "typing-optional", "numpy", "installation"]