【问题标题】:Cannot install aws-sam-cli using pip Python 2.7无法使用 pip Python 2.7 安装 aws-sam-cli
【发布时间】:2019-02-27 12:13:44
【问题描述】:

版本

Python:2.7.10

18.0

aws-cli:1.16.19

pip 18.0 来自 /Library/Python/2.7/site-packages/pip (python 2.7),aws-cli 版本基于 aws-cli/1.16.19 Python/2.7.10 Darwin/17.7.0 botocore/1.12 .9

错误

在下面的Step 5 上遇到以下错误:

Collecting aws-sam-cli
  Using cached https://files.pythonhosted.org/packages/ed/0a/448016d5004d1353229b6081c7a05d84c38be5bc70db72d0ac366372fc78/aws-sam-cli-0.6.0.tar.gz
    Complete output from command python setup.py egg_info:
    /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)
    error in aws-sam-cli setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected ',' or end-of-list in pathlib2~=2.3.2; python_version<"3.4" at ; python_version<"3.4"

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/1n/ppy1_69x0890_qjfyl9dpdpr0000gq/T/pip-install-FRmwqz/aws-sam-cli/

采取的步骤

使用this reference我执行了以下命令:

  1. 安装pip

    curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
    python get-pip.py
    
  2. ADD USER_BASE_PATHPATH:

    export USER_BASE_PATH=$(python -m site --user-base)
    export PATH=$PATH:$USER_BASE_PATH/bin
    
  3. 安装awscli

    pip --user install awscli
    

    不得不使用user 标志,因为pip install awscli 失败:

    Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/urllib3-1.23.dist-info'
    

    考虑使用--user 选项或检查权限。

  4. 安装aws-sam-cli:

    pip install --user aws-sam-cli
    

【问题讨论】:

    标签: python python-2.7 amazon-web-services command-line-interface aws-sam


    【解决方案1】:

    我遇到了同样的问题。必须升级setuptools 才能解决此问题。您可以尝试运行以下命令:

    pip install -U setuptools
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-06
      • 2017-06-03
      • 2014-12-22
      • 2015-06-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多