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

Unable to install awscli #6064

Closed
bvandermeersch opened this issue Apr 5, 2021 · 11 comments
Closed

Unable to install awscli #6064

bvandermeersch opened this issue Apr 5, 2021 · 11 comments
Assignees
Labels
guidance Question that needs advice or information. installation needs-reproduction This issue needs reproduction.

Comments

@bvandermeersch
Copy link

Since the Friday update my CI/CD pipeline is unable to install aws-cli

$ pip install awscli
Collecting awscli
  Downloading https://files.pythonhosted.org/packages/be/d0/00369b4001c5916e33d54055a7a3ed451bcb4c7679f65a80f6ba5b7c01a2/awscli-1.19.44-py2.py3-none-any.whl (3.6MB)
Collecting colorama<0.4.4,>=0.2.5 (from awscli)
  Downloading https://files.pythonhosted.org/packages/c9/dc/45cdef1b4d119eb96316b3117e6d5708a08029992b2fee2c143c7a0a5cc5/colorama-0.4.3-py2.py3-none-any.whl
Collecting PyYAML<5.5,>=3.10 (from awscli)
  Downloading https://files.pythonhosted.org/packages/a0/a4/d63f2d7597e1a4b55aa3b4d6c5b029991d3b824b5bd331af8d4ab1ed687d/PyYAML-5.4.1.tar.gz (175kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'
  Complete output from command /usr/bin/python2 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-b6L4p9 --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel Cython:
  Collecting setuptools
    Downloading https://files.pythonhosted.org/packages/94/75/05e1d69c61c4dfaf65ad12785cd18bedc1e0129976c55914d6aea59c7da8/setuptools-54.2.0.tar.gz (2.1MB)
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
      Complete output from command python setup.py egg_info:
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "setuptools/__init__.py", line 16, in <module>
          import setuptools.version
        File "setuptools/version.py", line 1, in <module>
          import pkg_resources
        File "pkg_resources/__init__.py", line 1367
          raise SyntaxError(e) from e
                                  ^
      SyntaxError: invalid syntax
      ----------------------------------------
  Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-nnn0wV/setuptools/
  ----------------------------------------
Command "/usr/bin/python2 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-b6L4p9 --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel Cython" failed with error code 1 in None
@bvandermeersch bvandermeersch added the needs-triage This issue or PR still needs to be triaged. label Apr 5, 2021
@bvandermeersch bvandermeersch changed the title Unable to install awscli since friday update Unable to install awscli Apr 5, 2021
@cavargas40
Copy link

cavargas40 commented Apr 5, 2021

I'm having the same issue here. Probably will need to install a specific version to prevent this issue.

@bvandermeersch
Copy link
Author

I'm having the same issue here. Probably will need to install a specific version to prevent this issue.

I tried rolling back to an older version without luck.

However, the issue seems to have resolved itself for me.

@kdaily kdaily added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Apr 5, 2021
@kdaily kdaily self-assigned this Apr 5, 2021
@kdaily kdaily added the needs-reproduction This issue needs reproduction. label Apr 5, 2021
@kdaily
Copy link
Member

kdaily commented Apr 5, 2021

Looks like you're using Python 2? You're trying to get setuptools-54.2.0 but can only use setuptools<45 for Python 2:

https://setuptools.readthedocs.io/en/latest/python%202%20sunset.html

I'm looking to see if any of the CLI or botocore dependencies changed that would impact this.

My successful attempt:

> python --version
Python 2.7.18
> pip install --force --no-cache-dir awscli
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting awscli
  Downloading awscli-1.19.44-py2.py3-none-any.whl (3.6 MB)
     |████████████████████████████████| 3.6 MB 3.1 MB/s
Collecting PyYAML<5.5,>=3.10
  Downloading PyYAML-5.4.1-cp27-cp27m-macosx_10_9_x86_64.whl (245 kB)
     |████████████████████████████████| 245 kB 2.4 MB/s
Collecting s3transfer<0.4.0,>=0.3.0
  Downloading s3transfer-0.3.6-py2.py3-none-any.whl (73 kB)
     |████████████████████████████████| 73 kB 3.3 MB/s
Collecting colorama<0.4.4,>=0.2.5
  Downloading colorama-0.4.3-py2.py3-none-any.whl (15 kB)
Collecting botocore==1.20.44
  Downloading botocore-1.20.44-py2.py3-none-any.whl (7.4 MB)
     |████████████████████████████████| 7.4 MB 2.8 MB/s
Collecting rsa<=4.5.0,>=3.1.2; python_version == "2.7"
  Downloading rsa-4.5-py2.py3-none-any.whl (36 kB)
Collecting docutils<0.16,>=0.10
  Downloading docutils-0.15.2-py2-none-any.whl (548 kB)
     |████████████████████████████████| 548 kB 3.0 MB/s
Collecting futures<4.0.0,>=2.2.0; python_version == "2.7"
  Downloading futures-3.3.0-py2-none-any.whl (16 kB)
Collecting jmespath<1.0.0,>=0.7.1
  Downloading jmespath-0.10.0-py2.py3-none-any.whl (24 kB)
Collecting python-dateutil<3.0.0,>=2.1
  Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
     |████████████████████████████████| 227 kB 2.8 MB/s
Collecting urllib3<1.27,>=1.25.4
  Downloading urllib3-1.26.4-py2.py3-none-any.whl (153 kB)
     |████████████████████████████████| 153 kB 2.8 MB/s
Collecting pyasn1>=0.1.3
  Downloading pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
     |████████████████████████████████| 77 kB 3.4 MB/s
Collecting six>=1.5
  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Installing collected packages: PyYAML, futures, jmespath, six, python-dateutil, urllib3, botocore, s3transfer, colorama, pyasn1, rsa, docutils, awscli
Successfully installed PyYAML-5.4.1 awscli-1.19.44 botocore-1.20.44 colorama-0.4.3 docutils-0.15.2 futures-3.3.0 jmespath-0.10.0 pyasn1-0.4.8 python-dateutil-2.8.1 rsa-4.5 s3transfer-0.3.6 six-1.15.0 urllib3-1.26.4
> pip list
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Package         Version
--------------- -------
awscli          1.19.44
botocore        1.20.44
colorama        0.4.3
docutils        0.15.2
futures         3.3.0
jmespath        0.10.0
pip             20.3.4
pyasn1          0.4.8
python-dateutil 2.8.1
PyYAML          5.4.1
rsa             4.5
s3transfer      0.3.6
setuptools      44.1.1
six             1.15.0
urllib3         1.26.4
wheel           0.36.2

@kdaily kdaily added guidance Question that needs advice or information. installation response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Apr 5, 2021
@1upD
Copy link

1upD commented Apr 6, 2021

I seem to be having a very similar issue trying to install awscli on a system with Python 2.7 right now.

`
Collecting awscli

Downloading awscli-1.19.45.tar.gz (1.4MB)

100% |████████████████████████████████| 1.4MB 403kB/s

Complete output from command python setup.py egg_info:

/usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
  warnings.warn(msg)

error in awscli setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers

`

I think this error is because setuptools is out of date. Trying to install setuptools, I'm running into difficulty installing a version that works with Python 2.7.

@KostyaRolique
Copy link

I receive such issue trying to install awscli with Python 2.7:

Collecting awscli
  Downloading https://files.pythonhosted.org/packages/3f/17/dfc4ec7991f2d98c4c6e6cf31a24066828ba82c739ffc2f9f9b11bfe0dec/awscli-1.19.45.tar.gz (1.4MB)
    100% |████████████████████████████████| 1.4MB 842kB/s eta 0:00:01
Exception:
Traceback (most recent call last):
  File "/opt/circleci/.pyenv/versions/2.7.12/lib/python2.7/site-packages/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/opt/circleci/.pyenv/versions/2.7.12/lib/python2.7/site-packages/pip/commands/install.py", line 299, in run
    requirement_set.prepare_files(finder)
  File "/opt/circleci/.pyenv/versions/2.7.12/lib/python2.7/site-packages/pip/req/req_set.py", line 360, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/opt/circleci/.pyenv/versions/2.7.12/lib/python2.7/site-packages/pip/req/req_set.py", line 647, in _prepare_file
    set(req_to_install.extras) - set(dist.extras)
  File "/opt/circleci/.pyenv/versions/2.7.12/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2810, in extras
    return [dep for dep in self._dep_map if dep]
  File "/opt/circleci/.pyenv/versions/2.7.12/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2624, in _dep_map
    dm.setdefault(extra,[]).extend(parse_requirements(reqs))
  File "/opt/circleci/.pyenv/versions/2.7.12/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2980, in parse_requirements
    "version spec")
  File "/opt/circleci/.pyenv/versions/2.7.12/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2956, in scan_list
    raise RequirementParseError(msg, line, "at", line[p:])
RequirementParseError: Expected ',' or end-of-list in rsa>=3.1.2,<=4.5.0; python_version=="2.7" at ; python_version=="2.7"
You are using pip version 8.1.1, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

This error came since this release v1.20.41: 557aa77

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Apr 6, 2021
@kdaily kdaily added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Apr 6, 2021
@kdaily
Copy link
Member

kdaily commented Apr 6, 2021

Hi @KostyaRolique, @1upD (and anyone else experiencing this issue) - thanks for the reports.

Can you confirm what your environment looks like?

  1. Operating system
  2. CLI version you're trying to install, and
  3. Output of pip list or the like to look at what's installed.

@KostyaRolique - it looks like you're experiencing a separate issue and need to upgrade pip.

@1upD - the link I posted about Python 2 sunsetting for setuptools lists some workarounds to get an appropriate version installed.

As a reminder to all, the AWS CLI will drop support for Python 2 on July 15, 2021:

https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-python-2-7-in-aws-sdk-for-python-and-aws-cli-v1/

@kdaily kdaily added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Apr 6, 2021
@vauchok
Copy link

vauchok commented Apr 7, 2021

Hi all,

I think it fixed in awscli-1.19.46:

Successfully installed awscli-1.19.46 botocore-1.20.46 colorama-0.4.3 docutils-0.15.2 futures-3.3.0 jmespath-0.10.0 pyasn1-0.4.8 python-dateutil-2.8.1 rsa-4.5 s3transfer-0.3.6 urllib3-1.26.4

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Apr 7, 2021
@nateprewitt
Copy link
Member

nateprewitt commented Apr 7, 2021

One commonality I'm seeing in the provided info is pip installations older than 9.0 (released 2016). This is the version that's considered the earliest point most modern Python packaging features were all available. Both the CLI and its dependencies release artifacts with the assumption end-users are using pip>=9.0.

For anyone still experiencing issues on Python 2.7, we'd recommend upgrading pip to 9.0 or later. If you're upgrading pip with a version of pip older than 9.0, you'll likely have issues with a standard pip install --upgrade pip. This is because that version of pip can't detect the latest compatible version and grabs the latest release (which doesn't support Python 2).

In that case, we'd recommend upgrading to a supported version for Python 2.7. That would be any version between 9.0 and 20.3.4 (pip install --upgrade "pip>=9.0,<=20.3.4"). We would highly discourage upgrading setuptools independently, because it's quite easy to break older versions of pip by upgrading dependencies underneath it.

@kdaily kdaily added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Apr 7, 2021
@naman1-gupta
Copy link

naman1-gupta commented Apr 9, 2021

I was facing a similar but not the exact same issue with the release of aws-cli v1.19.45 but it got automatically fixed in v1.19.46 and it has now come back in v1.19.48

Collecting awscli
  Downloading https://files.pythonhosted.org/packages/10/00/fc506c3bbeaec4ab4da4c33194582b85e0e0d6452a6f14aba6fff66c6b33/awscli-1.19.48.tar.gz (1.4MB)
    100% |████████████████████████████████| 1.4MB 771kB/s eta 0:00:011
Exception:
Traceback (most recent call last):
  File "/opt/circleci/.pyenv/versions/2.7.12/lib/python2.7/site-packages/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/opt/circleci/.pyenv/versions/2.7.12/lib/python2.7/site-packages/pip/commands/install.py", line 299, in run
    requirement_set.prepare_files(finder)
  File "/opt/circleci/.pyenv/versions/2.7.12/lib/python2.7/site-packages/pip/req/req_set.py", line 360, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/opt/circleci/.pyenv/versions/2.7.12/lib/python2.7/site-packages/pip/req/req_set.py", line 647, in _prepare_file
    set(req_to_install.extras) - set(dist.extras)
  File "/opt/circleci/.pyenv/versions/2.7.12/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2810, in extras
    return [dep for dep in self._dep_map if dep]
  File "/opt/circleci/.pyenv/versions/2.7.12/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2624, in _dep_map
    dm.setdefault(extra,[]).extend(parse_requirements(reqs))
  File "/opt/circleci/.pyenv/versions/2.7.12/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2980, in parse_requirements
    "version spec")
  File "/opt/circleci/.pyenv/versions/2.7.12/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2956, in scan_list
    raise RequirementParseError(msg, line, "at", line[p:])
RequirementParseError: Expected ',' or end-of-list in rsa>=3.1.2,<=4.5.0; python_version=="2.7" at ; python_version=="2.7"

I was able to fix the issue with @nateprewitt solution

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Apr 9, 2021
@kdaily
Copy link
Member

kdaily commented Apr 9, 2021

Thanks @nateprewitt! Marking this as resolved.

@kdaily kdaily closed this as completed Apr 9, 2021
@github-actions
Copy link

github-actions bot commented Apr 9, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information. installation needs-reproduction This issue needs reproduction.
Projects
None yet
Development

No branches or pull requests

8 participants