0

I have some code that I can run locally on my windows 10 machine that writes to a table on a DB2 sql database and runs perfectly. For reasons I can't seem to figure out, it doesn't work on the windows server 2008 R2 machine.

Works fine locally, but am at a total loss as to why it won't work on the server.

engine = create_engine('ibm_db_sa://{}:{}@host:port/db'.format('uid','pwd'))
df.to_sql(name=table, con=engine, if_exists='append', schema='schema', index=False)

I get the following error:

KeyError: '\x02'

Again, it works totally fine on my local machine, but deployment on a server gives me the above error. I've been trying to figure this out for the last few hours and it's driving me insane. Any help will be very very appreciated!!

  • EDIT your question to show the full traceback. Systematically determine the differences between the working and failing machine as regards Python and the versions of the modules that are present and pay attention if any modules are missing or different-versioned on the server side. – mao Oct 10 '19 at 08:07
  • Ughh I really wanted to avoid it, but you're right. I upgraded python to the latest version and it fixed it. Thanks! – Chester Poon Oct 10 '19 at 18:08

0 Answers0