- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
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:
- When creating or editing your Glue job in AWS Glue Studio, select "Python Shell script editor"
- Configure your job details (name, IAM role, etc.)
- For Python version, you can choose Python 3.9 which offers a flexible pre-loaded environment
- Select "Load common Python libraries" if you want pre-loaded libraries
- Add the
--additional-python-modulesparameter 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
Contenuto pertinente
- AWS UFFICIALEAggiornata 5 mesi fa

Does my Glue job need an internet access for this ?