# Connect Dremio with ipython notebook

**URL:** <https://community.dremio.com/t/connect-dremio-with-ipython-notebook/772>\
**Category:** Uncategorized\
**Created:** [February 16, 2018, 1:18pm UTC](https://community.dremio.com/t/connect-dremio-with-ipython-notebook/772 "2018-02-16T13:18:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![alokgogate](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@alokgogate](https://community.dremio.com/u/alokgogate)\
**Post date:** [February 16, 2018, 1:18pm UTC](https://community.dremio.com/t/connect-dremio-with-ipython-notebook/772/1 "2018-02-16T13:18:00Z")

</div>

I was trying to connect to ipython notebook with dremio server on my localhost (MacOS) by could not connect to it. Python version is 2.7 and pyodbc version is 3.1.1 My code below:  
import pyodbc, pandas

host = 'localhost’  
port = 31010  
uid = '\*\*\*\*\*\*'  
pwd = ‘\*\*\*\*\*\*’  
#driver =

cnxn = pyodbc.connect(“Driver={Dremio-ODBC};ConnectionType=Direct;HOST={%s};PORT={%d};AuthenticationType=Plain;UID={%s};PWD={%s}”.format(driver, host,port,uid,pwd),autocommit=True)

sql = ‘’‘SELECT \* FROM data’’’

dataframe = pandas.read\_sql(sql,cnxn)

Any help on this?

---

<div class="post-metadata">

**Author:** ![laurent](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/laurent/32/16_2.png) [@laurent](https://community.dremio.com/u/laurent)\
**Post date:** [February 16, 2018, 4:00pm UTC](https://community.dremio.com/t/connect-dremio-with-ipython-notebook/772/2 "2018-02-16T16:00:14Z")

</div>

Can you share the error message with us?

Make sure you also installed the ODBC Connector for MacOS, as it doesn’t come with the server application. You can find it at [https://www.dremio.com/download/](https://www.dremio.com/download/) and ODBC instructions are at: [https://docs.dremio.com/drivers/](https://docs.dremio.com/drivers/)

Note also that pyodbc and ODBC configuration on Mac might be slightly harder than on other platforms. MacOS provides an ODBC manager (iODBC), which can be configured by updating configuration files under `/Library/ODBC` (and `~/Library/ODBC`).When you run the Dremio Connector installer program, it registers the driver with it automatically. But for some reason, pyodbc on MacOS often requires another ODBC manager: unixODBC, and unixODBC configuration files are often located under `/etc`. If you are in this situation, you will have to update unixODBC configuration file to register the Dremio ODBC connector (you can simply copy the iODBC configuration).

---

<div class="post-metadata">

**Author:** ![alokgogate](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@alokgogate](https://community.dremio.com/u/alokgogate)\
**Post date:** [February 23, 2018, 9:26pm UTC](https://community.dremio.com/t/connect-dremio-with-ipython-notebook/772/3 "2018-02-23T21:26:33Z")

</div>

This is the error  
Error: (‘01000’, u"[01000] [unixODBC][Driver Manager]Can’t open lib ‘Dremio ODBC’ : file not found (0) (SQLDriverConnect)")

---

<div class="post-metadata">

**Author:** ![laurent](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/laurent/32/16_2.png) [@laurent](https://community.dremio.com/u/laurent)\
**Post date:** [February 25, 2018, 11:23pm UTC](https://community.dremio.com/t/connect-dremio-with-ipython-notebook/772/4 "2018-02-25T23:23:26Z")

</div>

It seems your pyodbc installation uses unixODBC. Can you see if the details I provided to you on how to configure unixODBC on Mac for the Dremio ODBC driver is helpful to you?

---

<div class="post-metadata">

**Author:** ![benji](https://avatars.discourse-cdn.com/v4/letter/b/f17d59/32.png) [@benji](https://community.dremio.com/u/benji)\
**Post date:** [May 7, 2018, 1:32pm UTC](https://community.dremio.com/t/connect-dremio-with-ipython-notebook/772/5 "2018-05-07T13:32:03Z")

</div>

I had a similar issue. If you look at `/Library/ODBC/odbc.ini`, you should see the configuration for the Dremio connector. Under the `driver` property, copy the given path and try using that for the `driver` string in your code. Mine is `/Library/Dremio/ODBC/lib/libdrillodbc_sbu.dylib`. This is an old thread, but someone hopefully will find it useful 😉

---

<div class="post-metadata">

**Author:** ![rmlopes](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@rmlopes](https://community.dremio.com/u/rmlopes)\
**Post date:** [March 20, 2020, 4:04pm UTC](https://community.dremio.com/t/connect-dremio-with-ipython-notebook/772/6 "2020-03-20T16:04:54Z")

</div>

Thank you @benji, you saved me a lot of time. Maybe this should be included somewhere in the documentation as almost two years later the issue persists.

---

<div class="post-metadata">

**Author:** ![ben](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/ben/32/1367_2.png) [@ben](https://community.dremio.com/u/ben)\
**Post date:** [March 20, 2020, 10:22pm UTC](https://community.dremio.com/t/connect-dremio-with-ipython-notebook/772/7 "2020-03-20T22:22:11Z")

</div>

@rmlopes, you can also copy the example `odbc.ini` file in your MacOS home directory and call it `.odbc.ini`. Then you could specify the `DSN` value in your connection string to be one those listed in that file.

---

<div class="post-metadata">

**Author:** ![jdlong](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/jdlong/32/3159_2.png) [@jdlong](https://community.dremio.com/u/jdlong)\
**Post date:** [May 23, 2022, 9:13pm UTC](https://community.dremio.com/t/connect-dremio-with-ipython-notebook/772/8 "2022-05-23T21:13:52Z")

</div>

well it’s been two more years since this was discussed here and I spent the better part of an afternoon last week fighting with the install of Dremio ODBC drivers using unixODBC on Mac. As mentioned above, the installer assumes use of iODBC, not unixODBC.

For me, it seems I needed to add the following `ODBCInstLib` path in my `dremio.drillodbc.ini` file that is buried deep in the Library. I never found documentation around this and sort of pieced it together from other bits of info elsewhere.

![image](https://us1.discourse-cdn.com/flex020/uploads/dremio/original/2X/b/be460a4a652db4aa474e252f78bfbda524c6e3e9.png)

The ideal situation would be to have the installer ask if the user wants iODBC install or unixODBC install. But short of that, at least having this documented would be super helpful.

-J

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [May 28, 2022, 6:34am UTC](https://community.dremio.com/t/connect-dremio-with-ipython-notebook/772/9 "2022-05-28T06:34:00Z")

</div>

Hi @jdlong Thanks for the detailed feedback, have passed it to the right team
