aws-sam-cli: Error installing aws-sam-cli
Error installing aws-sam-cli
Could not find a version that satisfies the requirement serverlessrepo==0.1.5 (from aws-sam-cli)
Steps to reproduce
- Enter
sudo pip3 install --user aws-sam-cli
orsudo pip3 install --user --upgrade aws-sam-cli
Observed result
The directory '/home/israel/.cache/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's -H flag.
The directory '/home/israel/.cache/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's -H flag.
Collecting aws-sam-cli
Downloading https://files.pythonhosted.org/packages/c3/7c/79463add5772a98f044fab3024c27db61550bb1d9bbd06a715e3c3dc6b2a/aws_sam_cli-0.10.0-py3-none-any.whl (423kB)
100% |████████████████████████████████| 430kB 1.6MB/s
Requirement already satisfied: Flask~=1.0.2 in /usr/local/lib/python3.5/dist-packages (from aws-sam-cli) (1.0.2)
Collecting dateparser~=0.7 (from aws-sam-cli)
Downloading https://files.pythonhosted.org/packages/ac/9e/1aa87c0c59f9731820bfd20a8b148d97b315530c2c92d1fb300328c8c42f/dateparser-0.7.0-py2.py3-none-any.whl (357kB)
100% |████████████████████████████████| 358kB 1.4MB/s
Collecting serverlessrepo==0.1.5 (from aws-sam-cli)
Could not find a version that satisfies the requirement serverlessrepo==0.1.5 (from aws-sam-cli) (from versions: 0.1.6)
No matching distribution found for serverlessrepo==0.1.5 (from aws-sam-cli)
Expected result
Successful Installation
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
- OS: Ubuntu 16.04
sam --version
: n/a
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 19 (6 by maintainers)
I faced the same error on Python 3.5.2. I switched to python 3.7 instead and the installation succeeded with the following command:
python3.7 -m pip install aws-sam-cli
SAM CLI supports Python2.7, 3.6, and 3.7. If you elect to install through pip instead of one of our installers (installers are preferred) then the python version you install into must be one of our supported versions.
I ran
brew reinstall aws-sam-cli
after following the process and got a successful download.Output:
Afterwards, running
sam --version
, I get this:You can follow the docs under “Install the AWS SAM CLI Using Linuxbrew” in the link I have above. This describes the step need to install.
https://stackoverflow.com/questions/21530577/fatal-error-python-h-no-such-file-or-directory Looks like you are missing header files from the python language.