I get
“Exception has occurred: OperationalError
(psycopg2.OperationalError) could not translate host name “stat-hh-postgresql” to address: Name or service not known”
when I run a function with Ubuntu but the same function works well with windows.
Also another function that fails to connect to MySQL database via Ubuntu, works well with windows.
def connect_to_modelDB():
engine = create_engine("postgresql+psycopg2://username:password@stat-hh-postgresql:5432/centralModelsDB")
modelDB = engine.connect()
return modelDB
I get “Exception has occurred: OperationalError
(psycopg2.OperationalError) could not translate host name “stat hh postgresql” to address: Name or service not known
(Background on this error at: https://sqlalche.me/e/14/e3q8)
psycopg2.OperationalError: could not translate host name “stat hh postgresql” to address: Name or service not known”