1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
0
You cannot install system headers or packages in the shell since that requires root access.
What you do instead is use a package that doesn't require the ODBC driver, like pymssql.
To do so, in the shell arguments (in the Job Details tab), add a parameter: --additional-python-modules with value pymssql
Then you can just use the library in the code, reference:
https://learn.microsoft.com/en-us/sql/connect/python/pymssql/step-3-proof-of-concept-connecting-to-sql-using-pymssql?view=sql-server-ver16
관련 콘텐츠
- AWS 공식업데이트됨 2년 전
- AWS 공식업데이트됨 2년 전
Hi Gonzalo Thanks so much for responding. I have tried pymssql. However, in my experience, it only installs with python 3.6 using whl file: pymssql-2.2.7-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl However, I need to use python 3.9 because I am using boto3 redshift-data api in the same script. When I try to install pymssql in python 3.9 with following file: pymssql-2.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl, I am unable to install it in AWS Glue Python Sell Job. Could you please guide me with the installation? I would be really grateful.
If your Shell has internet connectity, just specify "pymssql" as I showed above and pip will determine the right package. If you need to download the package and load it from s3, you do need to know which is the right one for that OS and Python version. To do so run once with internet access and see in the log which specific whl the Shell picks to install, then download the same.