Unable to run code through python file or jupyter (ipython notebook), working successfully through terminal python
<p>I have this python code:</p>

<pre><code>#!/usr/bin/env python
import pyodbc
from pandas import *
conn = pyodbc.connect("DSN=drill64", autocommit=True)
cursor = conn.cursor()
</code></pre>

<p>which on running as a .py file aur running through ipython notebook gives me the below error</p>

<pre><code>Traceback (most recent call last):
  File "/home/ubuntu/TestingDrillQuery.py", line 14, in &lt;module&gt;
    conn = pyodbc.connect("DSN=drill64", autocommit=True)
pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/opt/mapr/drillodbc/lib/64/libmaprdrillodbc64.so' : file not found (0) (SQLDriverConnect)")
[Finished in 0.4s with exit code 1]
</code></pre>

<p>On running through terminal python everything works smoothly, any suggestions appreciated.</p>

<p>Ok, I was able to solve it by changing permission to .py file
<code>chmod +x TestingDrillQuery.py</code></p>

python odbc pyodbc