Salta al contenuto

Install python moudles

0

Hi,

How can we install python modules in Glue python shell jobs ?

Thanks in advance

posta 5 mesi fa52 visualizzazioni
1 Risposta
0

In AWS Glue Python shell jobs, you can install additional Python modules using the --additional-python-modules job parameter. This approach works for AWS Glue versions 2.0, 3.0, and 4.0.

Here's how to install Python modules in Glue Python shell jobs:

  1. When creating or editing your Glue job in AWS Glue Studio, select "Python Shell script editor"
  2. Configure your job details (name, IAM role, etc.)
  3. For Python version, you can choose Python 3.9 which offers a flexible pre-loaded environment
  4. Select "Load common Python libraries" if you want pre-loaded libraries
  5. Add the --additional-python-modules parameter in the job parameters section with a comma-separated list of the modules you want to install

For example, if you want to install the 'textdistance' module, you would add --additional-python-modules textdistance==4.2.1 (specifying the version as needed).

You can also use the --python-modules-installer-option parameter to pass additional options to pip3 when installing the modules.

This method works for both standard Python modules and those written in C-based languages. Once configured, you can simply import and use these modules in your Python shell script without needing to use pip install commands in your code.
Sources
Use external Python libraries in your AWS Glue job | AWS re:Post
AWS Glue Visual ETL - Install/ import packages | AWS re:Post
Using job parameters in AWS Glue jobs - AWS Glue
AWS Glue Python shell now supports Python 3.9 with a flexible pre-loaded environment and support to install additional libraries | AWS Big Data Blog

con risposta 5 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.