For my test, I am running grid and node locally on different ports.
java -jar /usr/bin/selenium-server.jar -port 4444 -role hub
java -jar /usr/bin/selenium-s
You are passing desired_capabilities which is mostly the Module to the server which is not correct.
driver = webdriver.Remote(command_executor='http://127.0.0.1:4444/wd/hub', desired_capabilities=desired_capabilities)
Should be
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
driver = webdriver.Remote(command_executor='http://127.0.0.1:4444/wd/hub', desired_capabilities=DesiredCapabilities.FIREFOX)