Error initializing the driver: 'NoneType' object has no attribute 'to_capabilities'

Hello everyone i am stuck with the appium - python - cucumber. Can please someone help?

Here is full error:

Initializing Appium driver with desired capabilities…
Error initializing the driver: ‘NoneType’ object has no attribute ‘to_capabilities’
HOOK-ERROR in before_all: AttributeError: ‘NoneType’ object has no attribute ‘to_capabilities’
HOOK-ERROR in after_all: AttributeError: ‘Context’ object has no attribute ‘driver’

my env file

from appium import webdriver
from behave import use_fixture

def before_all(context):
    try:
        desired_caps = {
            'platformName': 'Android',
            'deviceName': 'emulator-5554',
            'platformVersion': '14',
            'app': 'C:\\Users\\jakub\\Downloads\\Appium\\AppiumProject\\amaze-file-manager-3-10.apk',
            'automationName': 'UiAutomator2'
        }
        print("Initializing Appium driver with desired capabilities...")
        context.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
        print("Driver initialized:", context.driver)
    except Exception as e:
        print(f"Error initializing the driver: {e}")
        raise

    
def after_all(context):
    """
    Teardown that runs after all tests.
    Here you might close the connection to the Appium server.
    """
    context.driver.quit()

def before_feature(context, feature):
    """
    This runs before each feature file is exercised.
    """
    # Setup specific to a feature can be added here.

def after_feature(context, feature):
    """
    This runs after each feature file is exercised.
    """
    # Teardown specific to a feature can be added here.

def before_scenario(context, scenario):
    """
    This runs before each scenario is run.
    """
    # Setup specific to a scenario can be added here.

def after_scenario(context, scenario):
    """
    This runs after each scenario is run.
    """
    # Teardown specific to a scenario can be added here.

Thanks for your help i downgraded versions, now i am getting error:
Initializing Appium driver with desired capabilities…
Error initializing the driver: Message: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource

HOOK-ERROR in before_all: WebDriverException: Message: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
HOOK-ERROR in after_all: AttributeError: ‘Context’ object has no attribute ‘driver’

Myversions: Appium-Python-Client==2.10.0, selenium==4.1.0, Python 3.12.2, appium: 2.5.1, [email protected]

This is way too new.

I have the following and they are working with example code from the Github link above:
Appium-Python-Client 3.2.0
selenium 4.18.1
Python 3.11.7
Appium 2.4.1

I think you should downgrade Python (I use pyenv) and model your code after the example provided.