anchore / anchore-cli

Simple command-line client to the Anchore Engine service
Apache License 2.0
114 stars 55 forks source link

problems with anchore-cli on mac #9

Closed rossayoung closed 5 years ago

rossayoung commented 6 years ago
screen shot 2018-04-11 at 11 01 27 pm screen shot 2018-04-11 at 11 02 17 pm

Please note on the mac installation instructions sh-3.2# pip install --user anchorecli

Requirement already satisfied: anchorecli in /private/var/root/Library/Python/2.7/lib/python/site-packages (0.2.0.dev0) Requirement already satisfied: click==6.7 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from anchorecli) (6.7) Requirement already satisfied: prettytable==0.7.2 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from anchorecli) (0.7.2) Requirement already satisfied: requests==2.17.3 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from anchorecli) (2.17.3) Requirement already satisfied: urllib3==1.21.1 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from anchorecli) (1.21.1) Requirement already satisfied: python-dateutil==2.6.0 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from anchorecli) (2.6.0) Requirement already satisfied: PyYAML==3.12 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from anchorecli) (3.12) Requirement already satisfied: certifi>=2017.4.17 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from requests==2.17.3->anchorecli) (2018.1.18) Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from requests==2.17.3->anchorecli) (3.0.4) Requirement already satisfied: idna<2.6,>=2.5 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from requests==2.17.3->anchorecli) (2.5) Requirement already satisfied: six>=1.5 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from python-dateutil==2.6.0->anchorecli) (1.11.0) matplotlib 1.3.1 has requirement numpy>=1.5, but you'll have numpy 1.8.0rc1 which is incompatible. sh-3.2#

If I try to install by following the instructions from source I see the following sh-3.2# pip install --user --upgrade . Processing /root/aevolume/config/anchore-cli Requirement not upgraded as not directly required: click==6.7 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from anchorecli==0.2.0.dev0) (6.7) Requirement not upgraded as not directly required: prettytable==0.7.2 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from anchorecli==0.2.0.dev0) (0.7.2) Requirement not upgraded as not directly required: requests==2.17.3 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from anchorecli==0.2.0.dev0) (2.17.3) Requirement not upgraded as not directly required: urllib3==1.21.1 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from anchorecli==0.2.0.dev0) (1.21.1) Requirement not upgraded as not directly required: python-dateutil==2.6.0 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from anchorecli==0.2.0.dev0) (2.6.0) Requirement not upgraded as not directly required: PyYAML==3.12 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from anchorecli==0.2.0.dev0) (3.12) Requirement not upgraded as not directly required: certifi>=2017.4.17 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from requests==2.17.3->anchorecli==0.2.0.dev0) (2018.1.18) Requirement not upgraded as not directly required: chardet<3.1.0,>=3.0.2 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from requests==2.17.3->anchorecli==0.2.0.dev0) (3.0.4) Requirement not upgraded as not directly required: idna<2.6,>=2.5 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from requests==2.17.3->anchorecli==0.2.0.dev0) (2.5) Requirement not upgraded as not directly required: six>=1.5 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from python-dateutil==2.6.0->anchorecli==0.2.0.dev0) (1.11.0) matplotlib 1.3.1 has requirement numpy>=1.5, but you'll have numpy 1.8.0rc1 which is incompatible. Installing collected packages: anchorecli Found existing installation: anchorecli 0.2.0.dev0 Uninstalling anchorecli-0.2.0.dev0: Successfully uninstalled anchorecli-0.2.0.dev0 Running setup.py install for anchorecli ... done Successfully installed anchorecli-0.2.0.dev0 sh-3.2# anchore-cli image add docker.io/library/debian:latest sh: anchore-cli: command not found

nurmi commented 6 years ago

Hi @rossayoung -

It looks like for the first case (where you're running a an install of the release version from pypi), the error is indicating that there is some other dependency installed on your system that cannot be resolved by pip - ("matplotlib 1.3.1 has requirement numpy>=1.5, but you'll have numpy 1.8.0rc1 which is incompatible."). Something seems to be a bit off there in pip, as I would expect for 1.8.0rc1 to evaluate as > 1.5, but this isn't something we can control in anchore itself as numpy is not a direct requirement (i have a suggestion at the end of this message, but wanted to address each condition you've reported in turn)

The second installation looks like it succeeded, but you should note that when using '--user' option to pip, the scripts/binaries do not appear to be installing in a location that is in your $PATH. To find the binary, you can run a command like 'find ~ --name anchore-cli' and then run the command - for example my version of pip/OSX results in this:

$ find ~ -name anchore-cli
/Users/nurmi/Library/Python/2.7/bin/anchore-cli
$ 

so I can either run the command by supplying the full path

/Users/nurmi/Library/Python/2.7/bin/anchore-cli --help

or I can add that directory to my default $PATH for future installation of python programs via pip.

I did want to note that, since we're working with containers, we do also offer a container that has the anchore-cli pre-installed, which you could use instead of installing natively in order to avoid dependency wrangling - the container is located at the following link, along with some instructions on how to run it, if you choose to go that route: https://hub.docker.com/r/anchore/engine-cli/

Regards, -Dan

rossayoung commented 6 years ago

Hi Dan once i used the docke container for anchore/cli everything seemed to work well. Can you tell me the difference between the engine-cli container and the cli container

Thank you Ross

On Wed, Apr 11, 2018 at 11:44 PM Dan Nurmi notifications@github.com wrote:

Hi @rossayoung https://github.com/rossayoung -

It looks like for the first case (where you're running a an install of the release version from pypi), the error is indicating that there is some other dependency installed on your system that cannot be resolved by pip - ("matplotlib 1.3.1 has requirement numpy>=1.5, but you'll have numpy 1.8.0rc1 which is incompatible."). Something seems to be a bit off there in pip, as I would expect for 1.8.0rc1 to evaluate as > 1.5, but this isn't something we can control in anchore itself as numpy is not a direct requirement (i have a suggestion at the end of this message, but wanted to address each condition you've reported in turn)

The second installation looks like it succeeded, but you should note that when using '--user' option to pip, the scripts/binaries do not appear to be installing in a location that is in your $PATH. To find the binary, you can run a command like 'find ~ --name anchore-cli' and then run the command - for example my version of pip/OSX results in this:

$ find ~ -name anchore-cli /Users/nurmi/Library/Python/2.7/bin/anchore-cli $

so I can either run the command by supplying the full path

/Users/nurmi/Library/Python/2.7/bin/anchore-cli --help

or I can add that directory to my default $PATH for future installation of python programs via pip.

I did want to note that, since we're working with containers, we do also offer a container that has the anchore-cli pre-installed, which you could use instead of installing natively in order to avoid dependency wrangling - the container is located at the following link, along with some instructions on how to run it, if you choose to go that route: https://hub.docker.com/r/anchore/engine-cli/

Regards, -Dan

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/anchore/anchore-cli/issues/9#issuecomment-380668911, or mute the thread https://github.com/notifications/unsubscribe-auth/ALQ6e7nSUPik3pExkQ6453oi2UqmOPYsks5tns2qgaJpZM4TREIQ .

nurmi commented 6 years ago

Hi @rossayoung - the anchore/cli container is for the original low-level anchore analyzer, which will not be supported moving forward unfortunately. Instead, we recommend the anchore-engine service (which is a service that provides an API and much more functionality around the core analyzer), along with the anchore/engine-cli which is the command-line client for anchore-engine (the project where this ticket is being discussed).

Best Regards, -Dan

AlekKras commented 5 years ago

It could be in the wrong thread, but I thought to share this to save someone hours of googling: For anyone who may run into this issue, if you did installation and had a folder structure like this:

.
├── config
│   └── config.yaml
├── db 
└── docker-compose.yaml

Try running source ~/.profile and then run anchore-cli --version. It helped me (make sure that you have docker engine running of course).