import awscli.clidriver ImportErr...">

AWS cli started with an error today ...?

On linux server:

File "/usr/local/bin/aws", line 19, in <module> 
   import awscli.clidriver
ImportError: No module named awscli.clidriver

Any idea why this could start?

+4
source share
1 answer

The current execution context is not aware of the preferences of the python environment.

All you have to do is assign an environment variable PYTHONPATHbefore 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

, site-packages.

0

Source: https://habr.com/ru/post/1611035/


All Articles