title: Getting error while reading data from Microsoft SQL Server using ‘awswrangler’ & ‘pyodbc’ in AWS Glue Job[Spark 2.4, Python 3 (Glue Version 2.0)]
body: <ol>
  <li>Code in Python–</li>
  </ol>
  <pre class="lang-py prettyprint-override"><code>    from pyspark.shell import spark
      from pyspark.sql import SparkSession
      from pyspark.sql.functions import *
      import datetime
      import logging
      import awswrangler as wr
      from awswrangler import _databases as _db_utils
      from pandas import DataFrame
      import pandas as pd
      
              connection = wr.sqlserver.connect(connection='', secret_id='')
              with connection.cursor() as cursor:
                  assignment = cursor.execute(
                      'SELECT * from AssignmentData').fetchall()
                  assignment_dataframe = DataFrame(assignment)
                  return assignment_df
  </code></pre>
  <ol start="2">
  <li>I’m using python wheel of <code>pyodbc</code>  named <code>pyodbc-4.0.32-cp37-cp37m-linux_x86_64.whl</code> in my AWS Glue Job using</li>
  </ol>
  <ul>
  <li>Key: <code>--additional-python-modules</code></li>
  <li>Value: S3 Path.</li>
  </ul>
  <ol start="3">
  <li><p>I’ve created above <code>pyodbc</code> wheel using AmazonLinux Docker Image. Taken reference from Use external Python libraries in your AWS Glue 2.0 job (amazon.com)
  Pyodbc wheel file is attached.</p>
  </li>
  <li><p>In CloudWatch, I can see that all the packages including pyodbc and aws wrangler are installed successfully during the Glue Job Run.</p>
  </li>
  </ol>
  <p><img src="https://i.stack.imgur.com/j2ywR.jpg" alt="" /></p>
  <ol start="5">
  <li>Now I’m getting this weird Error-
  ImportError: libodbc.so.2: cannot open shared object file: No such file or directory
  2021-11-09 11:18:29,088 ERROR [main] glue.ProcessLauncher (Logging.scala:logError(70)): Error from Python:Traceback (most recent call last): File &quot;/tmp/load-assignment.py&quot;, line 3, in  from pyodbc.<strong>init</strong> import * ImportError: libodbc.so.2: cannot open shared object file: No such file or directory</li>
  </ol>
  <p><img src="https://i.stack.imgur.com/WgeU6.jpg" alt="" /></p>
  <ol start="6">
  <li>It is unable to import pyodbc package due to Import Error – libodbc.so.2 does not exist.
  I would highly appreciate if you can help me on this issue.
  Thanks.</li>
  </ol>