I am running a script on EC2 based on ami-0130c3a072f3832ff
2018.03 version.
In the list of preinstalled packages there is python-boto3
But when I try to import boto3
it says No module named: boto3
How can I resolve this issue?
Note: There is a problem, in this situation I can't use the internet (I would have used pip if this was possible)
EDIT1:
- Python 2.7
- Packages checked http://aws.amazon.com/amazon-linux-ami/2018-03-packages
- Instance-store backed is used, I don't know if it makes difference using the ebs-backed version.
EDIT2: I am starting a EC2 instance to run the script on startup and shut down after the execution.
instance = EC2.run_instances(
ImageId=AMI,
InstanceType=INSTANCE_TYPE,
MinCount=1,
MaxCount=1,
InstanceInitiatedShutdownBehavior='terminate',
UserData=script
)
The script is written in Python and begins with #!/usr/bin/env python