Your import and traversal initialization looks different compared to the python driver example here https://github.com/apache/tinkerpop/blob/3.7-dev/gremlin-python/src/main/python/examples/connections.py. Does it work if you change your code to be consistent with the example?
from gremlin_python.process.anonymous_traversal import traversal
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
rc = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g')
g = traversal().with_remote(rc)