# Dremio Python connection

**URL:** <https://community.dremio.com/t/dremio-python-connection/9341>\
**Category:** Uncategorized\
**Created:** [June 24, 2022, 3:02pm UTC](https://community.dremio.com/t/dremio-python-connection/9341 "2022-06-24T15:02:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gpalazzo](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@gpalazzo](https://community.dremio.com/u/gpalazzo)\
**Post date:** [June 24, 2022, 3:02pm UTC](https://community.dremio.com/t/dremio-python-connection/9341/1 "2022-06-24T15:02:04Z")

</div>

Hi community.

I’m new to Dremio. I was able to successfully setup a dremio service, create a dataset through query.  
Now I would like to retrieve this dataset from Python.

I’ve explored the following solutions:

1. [Dremio REST API | Dremio](https://www.dremio.com/resources/tutorials/using-the-rest-api/)
2. [Dremio](https://docs.dremio.com/software/client-applications/python/)

The errors I receive for each attempt are:

1. TypeError: ‘NoneType’ object is not subscriptable – when executing the step: jobid = querySQL(query)
2. FlightUnavailableError: Flight returned unavailable error, with message: failed to connect to all addresses

My next attempt will be via pyodbc.

Any ideas on how to solve the issues? I particularly like the solution number 1 with direct connect to Dremio API.

PS: not sure if it’s relevant, but I’m using Dremio Community Edition inside a Docker Container.

Thanks.

---

<div class="post-metadata">

**Author:** ![YEN](https://avatars.discourse-cdn.com/v4/letter/y/50afbb/32.png) [@YEN](https://community.dremio.com/u/YEN)\
**Post date:** [June 24, 2022, 3:43pm UTC](https://community.dremio.com/t/dremio-python-connection/9341/2 "2022-06-24T15:43:00Z")

</div>

Hi, if you want to use Arrow flight, try to look over there:

> [@Install/config issue arrow flight on dremio docker](https://community.dremio.com/t/install-config-issue-arrow-flight-on-dremio-docker/7045/2):
>
> Hi, Yes, you will have to amend the dremio.conf config file. You can use a “docker exec -it yourdockername bash” but the issue is that you will not have any editor to amend the file inside of the container. you will still be able to find the file: [image] I end up moving the file between the host and the docker with: docker cp youdockername:/opt/dremio/conf/dremio.conf . [image] Amend the file: [image] The save it / copy back to the container docker cp dremio.conf dremio13v2:/opt/dremi…

You should have all steps regarding the docker amendment and py script.

---

<div class="post-metadata">

**Author:** ![gpalazzo](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@gpalazzo](https://community.dremio.com/u/gpalazzo)\
**Post date:** [June 24, 2022, 4:42pm UTC](https://community.dremio.com/t/dremio-python-connection/9341/3 "2022-06-24T16:42:16Z")

</div>

hi there @YEN !  
thanks for answering my question.

I was doing a port mapping the wrong way, that’s why it wasn’t working.  
Following this tutorial: [Dremio](https://docs.dremio.com/software/client-applications/python/) with latest dremio-oss docker image works like a charm.

Thanks.
