Having trouble starting the Appium driver using Python

Here is the error:
Traceback (most recent call last):
File “D:\appiumPython\basicTests.py”, line 13, in
driver = webdriver.Remote(‘http://localhost:4723/wd/hub’, desired_capabilities)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “D:\appiumPython.venv\Lib\site-packages\appium\webdriver\webdriver.py”, line 229, in init
super().init(
File “D:\appiumPython.venv\Lib\site-packages\selenium\webdriver\remote\webdriver.py”, line 189, in init
capabilities = options.to_capabilities()
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: ‘NoneType’ object has no attribute ‘to_capabilities’

Process finished with exit code 1

My simple code is:
from appium import webdriver
from appium.webdriver.common.appiumby import AppiumBy

desired_capabilities = {
‘platformName’: ‘Android’,
‘deviceName’: ‘Pixel 7 Pro’,
‘app’: ‘D://appiumPython//ApiDemos-debug.apk’,
‘automationName’: ‘UiAutomator2’,
‘fullReset’: True,
‘uiautomator2ServerInstallTimeout’: 60000
}

driver = webdriver.Remote(‘http://localhost:4723/wd/hub’, desired_capabilities)

Is sir blocked from accessing Google?

https://stackoverflow.com/questions/77118636/attributeerror-nonetype-object-has-no-attribute-to-capabilities-getting-th

Thanks for responding.
I cannot still initiate the application with automation. Kindly, help me out of this:

Error:
Traceback (most recent call last):
File “D:\appiumPython\tests\demo3.py”, line 20, in
driver = webdriver.Remote(command_executor=appium_server_url, options=appium_options.load_capabilities((capabilities)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “D:\appiumPython.venv\Lib\site-packages\appium\webdriver\webdriver.py”, line 229, in init
super().init(
File “D:\appiumPython.venv\Lib\site-packages\selenium\webdriver\remote\webdriver.py”, line 209, in init
self.start_session(capabilities)
File “D:\appiumPython.venv\Lib\site-packages\appium\webdriver\webdriver.py”, line 321, in start_session
response = self.execute(RemoteCommand.NEW_SESSION, w3c_caps)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “D:\appiumPython.venv\Lib\site-packages\selenium\webdriver\remote\webdriver.py”, line 348, in execute
self.error_handler.check_response(response)
File “D:\appiumPython.venv\Lib\site-packages\selenium\webdriver\remote\errorhandler.py”, line 229, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.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

My Code:
import time
from appium import webdriver
from appium.webdriver.common.appiumby import AppiumBy # Updated import statement

capabilities = {
“appium:platformName”: “Android”,
“appium:deviceName”: “Pixel 7 Pro”,
“appium:app”: “D://appiumPython//Applications//facebook.apk”,
“appium:automationName”: “UiAutomator2”,
“appium:fullReset”: True,
“appium:uiautomator2ServerInstallTimeout”: 60000
}

appium_server_url = ‘http://127.0.0.1:4723/wd/hub

Initialize AppiumOptions and add capabilities

appium_options = webdriver.webdriver.AppiumOptions()

Initialize the driver with the AppiumOptions

driver = webdriver.Remote(command_executor=appium_server_url, options=appium_options.load_capabilities((capabilities)))

driver.find_element(AppiumBy.ACCESSIBILITY_ID, “Media”).click() # Updated usage of AppiumBy
time.sleep(3)

audioFxText = driver.find_element(AppiumBy.ACCESSIBILITY_ID, “AudioFx”).text # Updated usage of AppiumBy
assert audioFxText == “AudioFx”

driver.quit()