AWS cli started with an error today ...?
The current execution context is not aware of the preferences of the python environment.
All you have to do is assign an environment variable PYTHONPATH
before executing the command awscli
.
Example:
export PYTHONPATH=$PYTHONPATH:/home/ubuntu/.local/lib/python2.7/site-packages
# For example list files from your bucket
aws s3 ls s3://mybucket --recursive
To set the correct path for PYTHONPATH
, you need to check where the python packages are installed on your computer / server. The above example from my ubuntu 16.04 server, python2.7 was installed compiling the python source code.
, python, site-packags
dist-packages
, python.
, , :
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/dist-packages