Aws CLI cannot be used because of colorama module

I have installed AWS CLI and am trying to use it on Mac OS Sierra. He complains that there is no module colorama

:

$ aws

Traceback (most recent call last):
  File "/usr/local/bin/aws", line 19, in <module>
    import awscli.clidriver
  File "/Library/Python/2.7/site-packages/awscli/clidriver.py", line 26, in <module>
    from awscli.formatter import get_formatter
  File "/Library/Python/2.7/site-packages/awscli/formatter.py", line 19, in <module>
    from awscli.table import MultiTable, Styler, ColorizedStyler
  File "/Library/Python/2.7/site-packages/awscli/table.py", line 18, in <module>
    import colorama
ImportError: No module named colorama

      

So I am trying to install it and it says the requirement has already been met:

$ sudo pip install colorama

The directory '/Users/danniu/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo -H flag.
The directory '/Users/danniu/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo -H flag.
Requirement already satisfied: colorama in /Users/danniu/Library/Python/2.7/lib/python/site-packages

      

+3


source to share


2 answers


Don't install Python modules with sudo

. If you add a command line parameter --user

, this will install the package to your home folder (which your user owns) and you won't need to use sudo

.

If you want this to be the default, you can create a file pip.conf

with the following content:

[install]
user = true

      

where it should be on your operating system (on macOS Sierra it is in $HOME/Library/Application Support/pip/pip.conf

).



The simplest solution to your problem is to run

$ pip install --upgrade --user awscli

      

as this will ensure that you have all the required dependencies.

+5


source


I faced this problem and pip install --ignore-installed six --upgrade --user awscli

.

More details on why should be used --ignore-installed six

for the github issue raised to install awscli on mac . https://github.com/pypa/pip/issues/3165 .



Also read the AWS Doc on how to install the AWS CLI: - http://docs.aws.amazon.com/cli/latest/userguide/installing.html

+1


source







All Articles