- Le plus récent
- Le plus de votes
- La plupart des commentaires
Hello! Unfortunately I still can not see any answers to the original question. How can I add new type of ODBC driver to pyodbc in python shell (e.g. DB2)? Glue 4.0 job above python 3.9 with "library-set":"analytics" parameter provide the pyodbc library, but I have not found any example or guide to add DB2 ODBC driver.
For Python V 3.9 or upwards, please follow https://docs.aws.amazon.com/glue/latest/dg/add-job-python.html#create-python-extra-library
- pyodbc is already supported by python shell Glue jobs - so, you should be able to import that library directly.
- For other libraries (or other version of pyodbc), please provide a whl/egg file or use pip commands.
For older versions, download the wheel file from https://pypi.org/project/openpyxl/#files and uploaded it to Amazon S3 and get the S3 URI. if you are creating/editing the Python shell in the console: Job Details , Advanced properties, Additional Python Files. If you are using command lines use these properties:
--default-arguments '{"--extra-py-files" : ["s3URI"]}
Contenus pertinents
- demandé il y a un an
- demandé il y a un an
- demandé il y a un mois
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 2 ans
I understand that the pyodbc library is supported in Python shell Glue jobs. My question is about adding new ODBC drivers to my Glue job so that I can use them with pyodbc
The drivers for Ms SQL should be available in Python Shell job. Please try the following: Create a glue connection to your database (it's in Glue Console > Connections > Choose JDBC), test the connection make sure it can hit your database Now in your job, you must set it to reference/use this connection. (Check Settings).
I have connected to MS SQL is my Glue Shell job using pymysql. https://pymssql.readthedocs.io/en/latest/
Please let me know if you still face any trouble. If this helps, please upvote/accept answer.
To elaborate on the second option proposed there (install a different version), you can use --additional-python-modules the value is passed directly to pip so you can ask for a specific version, for instance --additional-python-module with value "pyodbc==4.0.34"