Unable to write data to DB on Ubuntu 20.04

I am trying to write some data to InfluxDB 1.8 using the Python API but I am getting the below error. It works from a Windows machine but not on my Ubuntu 20.04 VM. Any idea what is causing this error?

> The batch item wasn't processed successfully because: Failed to parse: http://192.168.1.102:8086/api/v2/write?org=test&bucket=mybucket&precision=ns
> The batch item wasn't processed successfully because: Failed to parse: http://192.168.1.102:8086/api/v2/write?org=test&bucket=mybucket&precision=ns
> The batch item wasn't processed successfully because: Failed to parse: http://192.168.1.102:8086/api/v2/write?org=test&bucket=mybucket&precision=ns
> The batch item wasn't processed successfully because: Failed to parse: http://192.168.1.102:8086/api/v2/write?org=test&bucket=mybucket&precision=ns
> The batch item wasn't processed successfully because: Failed to parse: http://192.168.1.102:8086/api/v2/write?org=test&bucket=mybucket&precision=ns

I found a solution on Github. This is with requests parsing the URL. I was able to fix it by upgrading the six package.

Github issue link- urllib3.exceptions.LocationParseError: Failed to parse · Issue #5476 · psf/requests · GitHub

pip3 install six==1.15.0