4

I am trying to install aws-cli using following command I tried it with following command also sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws But still getting the following error

Running cmd: /opt/homebrew/opt/[email protected]/bin/python3.11 -m venv /usr/local/aws
Running cmd: /usr/local/aws/bin/python -m pip install --no-binary :all: --no-cache-dir --no-index --find-links file://. setuptools_scm-3.3.3.tar.gz
Traceback (most recent call last):
  File "/Users/adityagarde/Documents/./awscli-bundle/install", line 258, in <module>
    main()
  File "/Users/adityagarde/Documents/./awscli-bundle/install", line 238, in main
    pip_install_packages(opts.install_dir)
  File "/Users/adityagarde/Documents/./awscli-bundle/install", line 148, in pip_install_packages
    _install_setup_deps(python, '.')
  File "/Users/adityagarde/Documents/./awscli-bundle/install", line 167, in _install_setup_deps
    run(
  File "/Users/adityagarde/Documents/./awscli-bundle/install", line 88, in run
    raise BadRCError("Bad rc (%s) for cmd '%s': %s" % (
BadRCError: Bad rc (1) for cmd '/usr/local/aws/bin/python -m pip install --no-binary :all: --no-cache-dir --no-index --find-links file://. setuptools_scm-3.3.3.tar.gz': Looking in links: file://.
Processing ./setuptools_scm-3.3.3.tar.gz
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 2
  ╰─> [54 lines of output]
      WARNING: The directory '/Users/adityagarde/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
      Looking in links: file://.
      ERROR: Exception:
      Traceback (most recent call last):
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/cli/base_command.py", line 180, in exc_logging_wrapper
          status = run_func(*args)
                   ^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/cli/req_command.py", line 248, in wrapper
          return func(self, options, args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/commands/install.py", line 377, in run
          requirement_set = resolver.resolve(
                            ^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 92, in resolve
          result = self._result = resolver.resolve(
                                  ^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
          state = resolution.resolve(requirements, max_rounds=max_rounds)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_vendor/resolvelib/resolvers.py", line 397, in resolve
          self._add_to_criteria(self.state.criteria, r, parent=None)
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _add_to_criteria
          if not criterion.candidates:
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_vendor/resolvelib/structs.py", line 156, in __bool__
          return bool(self._sequence)
                 ^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 155, in __bool__
          return any(self)
                 ^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, in <genexpr>
          return (c for c in iterator if id(c) not in self._incompatible_ids)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 44, in _iter_built
          for version, func in infos:
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 279, in iter_index_candidate_infos
          result = self._finder.find_best_candidate(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/index/package_finder.py", line 890, in find_best_candidate
          candidates = self.find_all_candidates(project_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/index/package_finder.py", line 817, in find_all_candidates
          collected_sources = self._link_collector.collect_sources(
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/index/collector.py", line 479, in collect_sources
          find_links_sources = collections.OrderedDict(
                               ^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/index/collector.py", line 480, in <genexpr>
          build_source(
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/index/sources.py", line 181, in build_source
          path = url_to_path(location)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/utils/urls.py", line 43, in url_to_path
          raise ValueError(
      ValueError: non-local file URIs are not supported on this platform: 'file://.'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 2
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

I have checked pip is already installed on my machine. I have upgraded it to latest version also. pip 23.3.1 from /opt/homebrew/lib/python3.11/site-packages/pip (python 3.11).

Would be glad to have some help to solve the issue.

I tried it with following command also sudo -H ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws But I am getting following error.

Running cmd: /opt/homebrew/opt/[email protected]/bin/python3.11 -m venv /usr/local/aws
Running cmd: /usr/local/aws/bin/python -m pip install --no-binary :all: --no-cache-dir --no-index --find-links file://. setuptools_scm-3.3.3.tar.gz
Traceback (most recent call last):
  File "/Users/adityagarde/Documents/./awscli-bundle/install", line 258, in <module>
    main()
  File "/Users/adityagarde/Documents/./awscli-bundle/install", line 238, in main
    pip_install_packages(opts.install_dir)
  File "/Users/adityagarde/Documents/./awscli-bundle/install", line 148, in pip_install_packages
    _install_setup_deps(python, '.')
  File "/Users/adityagarde/Documents/./awscli-bundle/install", line 167, in _install_setup_deps
    run(
  File "/Users/adityagarde/Documents/./awscli-bundle/install", line 88, in run
    raise BadRCError("Bad rc (%s) for cmd '%s': %s" % (
BadRCError: Bad rc (1) for cmd '/usr/local/aws/bin/python -m pip install --no-binary :all: --no-cache-dir --no-index --find-links file://. setuptools_scm-3.3.3.tar.gz': Looking in links: file://.
Processing ./setuptools_scm-3.3.3.tar.gz
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 2
  ╰─> [53 lines of output]
      Looking in links: file://.
      ERROR: Exception:
      Traceback (most recent call last):
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/cli/base_command.py", line 180, in exc_logging_wrapper
          status = run_func(*args)
                   ^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/cli/req_command.py", line 248, in wrapper
          return func(self, options, args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/commands/install.py", line 377, in run
          requirement_set = resolver.resolve(
                            ^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 92, in resolve
          result = self._result = resolver.resolve(
                                  ^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
          state = resolution.resolve(requirements, max_rounds=max_rounds)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_vendor/resolvelib/resolvers.py", line 397, in resolve
          self._add_to_criteria(self.state.criteria, r, parent=None)
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _add_to_criteria
          if not criterion.candidates:
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_vendor/resolvelib/structs.py", line 156, in __bool__
          return bool(self._sequence)
                 ^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 155, in __bool__
          return any(self)
                 ^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, in <genexpr>
          return (c for c in iterator if id(c) not in self._incompatible_ids)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 44, in _iter_built
          for version, func in infos:
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 279, in iter_index_candidate_infos
          result = self._finder.find_best_candidate(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/index/package_finder.py", line 890, in find_best_candidate
          candidates = self.find_all_candidates(project_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/index/package_finder.py", line 817, in find_all_candidates
          collected_sources = self._link_collector.collect_sources(
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/index/collector.py", line 479, in collect_sources
          find_links_sources = collections.OrderedDict(
                               ^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/index/collector.py", line 480, in <genexpr>
          build_source(
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/index/sources.py", line 181, in build_source
          path = url_to_path(location)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/aws/lib/python3.11/site-packages/pip/_internal/utils/urls.py", line 43, in url_to_path
          raise ValueError(
      ValueError: non-local file URIs are not supported on this platform: 'file://.'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 2
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip
2
  • I just ran into the same problem for a docker image that previously worked, do you have an idea what the cause is?
    – Motti
    Commented Feb 28, 2024 at 15:15
  • have the same problem on my mac with python3 + pip
    – Ievgen
    Commented Feb 28, 2024 at 20:16

3 Answers 3

8

I encountered this same error and ended up just running

brew install awscli

to install awscli.

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Feb 29, 2024 at 11:15
1

It would appear that aws-cli v1 is no longer working (even though Amazon claim it's still supported).

You may try moving v2 (https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)

0

At a quick glance it seems to be putting things into a virtual environment.

There are many ways to do this, including using Docker. However I'd recommend that you remove the version inside the venv and install globally.

Dockerization can happen inside at the project level and be handled by SAM while AWS can handle global permissions.

AWS docs recommends the following to install, assuming you are on a Mac (linux).

In terminal run:

curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg AWSCLIV2.pkg -target /

AWS CLI is composed of two key installs

  • awscli
  • sam

awscli will handle your user configure and sam will handle the IaC (Infrastructure as code).

Confirm it is installed with:

$ which aws

this should return

$ /usr/local/bin/aws

from there you can run aws configure to set your secret key.

finding sam is the same

$ which sam

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.