Package Details: aws-cli-v2 2.0.57-1

Git Clone URL: https://aur.archlinux.org/aws-cli-v2.git (read-only, click to copy)
Package Base: aws-cli-v2
Description: Universal Command Line Interface for Amazon Web Services (version 2)
Upstream URL: https://github.com/aws/aws-cli
Keywords: devops
Licenses: Apache
Conflicts: aws-cli, aws-cli-git, aws-cli-v2-bin
Provides: aws-cli
Submitter: dbirks
Maintainer: dbirks
Last Packager: dbirks
Votes: 3
Popularity: 0.52
First Submitted: 2020-06-24 20:18
Last Updated: 2020-10-16 17:49

Required by (14)

Sources (1)

Latest Comments

1 2 Next › Last »

aliencoder commented on 2020-09-29 08:40

@mnesterenko, I found the reason, I have it installed via my distro, and manually, when v2 came out there was no AUR package, so I did a manual install, and forgot about it.

mnesterenko commented on 2020-09-28 19:12

@aliencoder, that is strange path you have

I have checked built package contents:

$ pacman -Ql aws-cli-v2 | head -n 5
aws-cli-v2 /usr/
aws-cli-v2 /usr/bin/
aws-cli-v2 /usr/bin/aws
aws-cli-v2 /usr/bin/aws.cmd

You should have it by this path

aliencoder commented on 2020-09-28 06:01

Hi there, Editing the build scripts fixed the build, but it seems I still have the old

aws --version
aws-cli/2.0.33 Python/3.7.3 Linux/5.8.6-1-MANJARO botocore/2.0.0dev37

which aws
/usr/local/aws-cli/v2/current/bin/aws

any ideas?

L0-FF commented on 2020-09-27 22:00

Solved. Based on @aliencoder and my issues. Figured it had to do with PYTHONPATH.

Especially considering that the import error was referencing the $USER local dir: /home/$USER/.local/lib/python3.8/site-packages

I explicitly set PYTHONPATH to the proper global path and the local (for the package build) and all went as expected.

So for the PKGBUILD.

PYTHONPATH=.:/usr/lib/python3.8/site-packages ./scripts/gen-ac-index --index-location=./ac.index

Solves it. Pretty sure this will work for most users.

dbirks commented on 2020-09-27 03:59

Thank you all, I just moved PYTHONPATH inline.

mnesterenko commented on 2020-09-26 22:49

@dbirks, @L0-FF, not sure about this error, when PYTHONPATH is fixed aws-cli-v2 is built successfully:

Dockerfile that builds aws-cli-v2 with fixed PYTHONPATH:

from archlinux/base

run pacman -Syu --noconfirm git sudo vim binutils fakeroot shadow awk && \
    groupadd sudo && useradd test --create-home -G sudo && (echo test:test | chpasswd) && \
    (echo "test   ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/test)

workdir /home/test
user test

run git clone https://aur.archlinux.org/trizen.git && (cd trizen && makepkg -sri --noconfirm) && \
    trizen -S --noconfirm python-botocore-v2-git && \
    trizen -S --noconfirm python-colorama python-cryptography python-distro python-prompt_toolkit python-ruamel-yaml python-s3transfer && \
    git clone https://aur.archlinux.org/aws-cli-v2.git && ( \
            cd aws-cli-v2 && \
            echo -e '''diff --git a/PKGBUILD b/PKGBUILD\n\
index 0566e35..01ff3ed 100644\n\
--- a/PKGBUILD\n\
+++ b/PKGBUILD\n\
@@ -27,8 +27,7 @@ build() {\n\
     python setup.py build\n\
 \n\
     echo "Generating auto-complete index. Takes 5-10 minutes..."\n\
-    local PYTHONPATH=.\n\
-    ./scripts/gen-ac-index --index-location=./ac.index\n\
+    PYTHONPATH=. ./scripts/gen-ac-index --index-location=./ac.index\n\
 }\n\
 \n\
 package() {''' | git apply && makepkg -sri --noconfirm)

L0-FF commented on 2020-09-25 23:11

@mnesterenko's (thanks!) diff does fix the awscli module error.

The new error, is as reported by @aliencoder:

ImportError: cannot import name 'WordCompleter' from 'prompt_toolkit.completion' (/home/omar/.local/lib/python3.8/site-packages/prompt_toolkit/completion.py)
==> ERROR: A failure occurred in build().

mnesterenko commented on 2020-09-25 19:56

Hi dbirks,

please update PKGBUILD to following:

--- a/PKGBUILD
+++ b/PKGBUILD
@@ -27,8 +27,7 @@ build() {
     python setup.py build

     echo "Generating auto-complete index. Takes 5-10 minutes..."
-    local PYTHONPATH=.
-    ./scripts/gen-ac-index --index-location=./ac.index
+    PYTHONPATH=. ./scripts/gen-ac-index --index-location=./ac.index
 }

That will fix problem with the error:

Traceback (most recent call last):
  File "./scripts/gen-ac-index", line 8, in <module>
    from awscli.autocomplete.local import indexer
ModuleNotFoundError: No module named 'awscli'

aliencoder commented on 2020-09-25 07:02

Hi, I am facing this error:



Traceback (most recent call last):
  File "./scripts/gen-ac-index", line 54, in <module>
    main()
  File "./scripts/gen-ac-index", line 29, in main
    _generate_index(args.index_location)
  File "./scripts/gen-ac-index", line 44, in _generate_index
    driver = clidriver.create_clidriver()
  File "/usr/lib/python3.8/site-packages/awscli/clidriver.py", line 103, in create_clidriver
    load_plugins(session.full_config.get('plugins', {}),
  File "/usr/lib/python3.8/site-packages/awscli/plugin.py", line 48, in load_plugins
    _load_plugins(BUILTIN_PLUGINS, event_hooks)
  File "/usr/lib/python3.8/site-packages/awscli/plugin.py", line 62, in _load_plugins
    modules = _import_plugins(plugin_mapping)
  File "/usr/lib/python3.8/site-packages/awscli/plugin.py", line 76, in _import_plugins
    module = import(path, fromlist=[module])
  File "/usr/lib/python3.8/site-packages/awscli/handlers.py", line 43, in <module>
    from awscli.customizations.configure.configure import register_configure_cmd
  File "/usr/lib/python3.8/site-packages/awscli/customizations/configure/configure.py", line 27, in <module>
    from awscli.customizations.configure.sso import ConfigureSSOCommand
  File "/usr/lib/python3.8/site-packages/awscli/customizations/configure/sso.py", line 23, in <module>
    from prompt_toolkit.completion import WordCompleter
ImportError: cannot import name 'WordCompleter' from 'prompt_toolkit.completion' (/home/omar/.local/lib/python3.8/site-packages/prompt_toolkit/completion.py)
==> ERROR: A failure occurred in build().
    Aborting...

dbirks commented on 2020-09-23 18:50

Thank you just fixed that. The only way I found to fix it was to set PYTHONPATH=. in the project root.

sjuxax: Yes if you have the time to upstream that, I'd be grateful. It takes a while as it is.