Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws-sam-cli install fails. Error: Command '['/opt/homebrew/Cellar/aws-sam-cli/1.52.0/libexec/bin/python3.8', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1 #352

Open
sebastian-nomi opened this issue Jun 15, 2022 · 8 comments

Comments

@sebastian-nomi
Copy link

This is driving me crazy because I use AWS SAM 99% of the time at work. I had to uninstall/reinstall SAM and I get this error when I try to install it. Any help would be appreciated.

sebastian@Juans-MBP Downloads % brew tap aws/tap
brew install aws-sam-cli
==> Tapping aws/tap
Cloning into '/opt/homebrew/Library/Taps/aws/homebrew-tap'...
remote: Enumerating objects: 3618, done.
remote: Counting objects: 100% (1299/1299), done.
remote: Compressing objects: 100% (309/309), done.
remote: Total 3618 (delta 1169), reused 1042 (delta 990), pack-reused 2319
Receiving objects: 100% (3618/3618), 550.54 KiB | 2.70 MiB/s, done.
Resolving deltas: 100% (2642/2642), done.
Tapped 18 formulae (51 files, 713.7KB).
==> Downloading https://api.github.com/repos/aws/aws-sam-cli/tarball/v1.52.0
==> Downloading from https://codeload.github.com/aws/aws-sam-cli/legacy.tar.gz/refs/tags/v1.52.0
######################################################################## 100.0%
==> Installing aws-sam-cli from aws/tap
==> python3.8 -m venv --system-site-packages /opt/homebrew/Cellar/aws-sam-cli/1.52.0/libexec
Last 15 lines from /Users/sebastian/Library/Logs/Homebrew/aws-sam-cli/01.python3.8:
2022-06-15 22:45:31 +0000

python3.8
-m
venv
--system-site-packages
/opt/homebrew/Cellar/aws-sam-cli/1.52.0/libexec

Error: Command '['/opt/homebrew/Cellar/aws-sam-cli/1.52.0/libexec/bin/python3.8', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.

Specs:
MacOS Monterrey 12.4

sebastian@Juans-MBP Downloads % brew --version
Homebrew 3.5.2
Homebrew/homebrew-core (git revision 49d84ebfb3f; last commit 2022-06-15)
Homebrew/homebrew-cask (git revision 763a50c0b5; last commit 2022-06-15)

sebastian@Juans-MBP Downloads % python3 --version
Python 3.8.0
@KMurphs
Copy link

KMurphs commented Aug 7, 2022

Did you fix this issue?

@TheSoldier103
Copy link

I haven't fixed this issue. Has anyone fixed it?

@Tksn07
Copy link

Tksn07 commented Aug 25, 2022

I faced the same issue

@sriram-mv
Copy link
Contributor

sriram-mv commented Sep 7, 2022

What do you see when you run ..../python3.8 -Im ensurepip --upgrade --default-pip (I have truncated the path here, since it could different for folks) directly on the command line? do you see a traceback?

@Dry-Wi
Copy link

Dry-Wi commented Sep 17, 2022

I faced the same issue as well

@djfurman
Copy link

Plus 1, I'm seeing this on my new M1Max trying to setup.

@djfurman
Copy link

I'm seeing a report for

aws-sam-cli installation fails on macOS 11.3.1 because of missing [email protected] https://github.com/aws/homebrew-tap/issues/207
Installing aws-sam-cli with homebrew on Mac: This error originates from a subprocess, and is likely not a problem with pip https://github.com/aws/homebrew-tap/issues/369

However, [email protected] is successfully installed via brew (by this dependency)

/opt/homebrew/opt/[email protected]/libexec/bin/python --version
Python 3.8.14

Steps Attempted

  • Adding [email protected] as my only Python path => same error
  • Manually create venv and upgrade pip
    • python -m venv --system-site-packages /opt/homebrew/Cellar/aws-sam-cli/1.57.0/libexec
    • /opt/homebrew/Cellar/aws-sam-cli/1.57.0/libexec/bin/python -m pip install --upgrade pip
      • These succeed and create the venv which I can activate in my CLI

Then attempting to test, ran brew install aws-sam-cli, =>

brew install aws-sam-cli
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).

Warning: aws/tap/aws-sam-cli 1.57.0 is already installed and up-to-date.
To reinstall 1.57.0, run:
  brew reinstall aws-sam-cli

However sam is not anywhere in the path.

Trying again, with attempting brew's recommendation to reinstall, I hit the same error.

@djfurman
Copy link

Found a work around!

Circumstance

If you have to setup a ~/.pip/pip.conf for a proxy, non-PyPI mirror, or other settings; you'll like run into what I did above.

It's like the installer is somehow ignoring my local user settings, my PATH for the system Python I run, and all of my environment variables (which I have set for PIP). I can't explain why this works, but on a suggestion from a colleague I tried this and it was instant resolution.

Implementing the work around

  1. Create /Library/Application\ Support/pip/pip.conf (note this is the root (/Library) version without the hidden directory with the contents of pip.conf identical to your local user.
  2. Run brew install aws-sam-cli
  3. Everything runs and installas as expected!

Hope this helps someone else stuck here where I was!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants