1๐
โ
If you are trying to get environment variables by connecting to EC2 instance, there are couple of issues.
- Elastic Beanstalk container runs as virtualenv. So
$ python
in command line is not exactly the same interpreter as the one executing your container code. - Elastic Beanstalk environment executes initialization scripts, which populate environment variables for the container. Environment variables are not system environment variables, they are available to the code running in the container, and to container commands only.
As for the first part of your question, I would check what values do you get in the container and take it from there.
import os
cg_geoip = os.environ['CG_GEOIP']
geoip_library_path = os.environ['GEOIP_LIBRARY_PATH']
๐คkukido
Source:stackexchange.com