Repository: aws/aws-cli

Issue:
pip install awscli fails
I tried `pip install awscli` from https://github.com/aws/aws-cli/blob/develop/README.rst and failed:

http://sprunge.us/NfbW
/home/hendry/.pip/pip.log  = http://ix.io/7SC

Hilarious how bad Python packaging is. I'm running Archlinux with Python 3.3.2.



Discussion:
Same here. Also on Arch Linux:

```
$ python --version
Python 3.3.2
```

```
$ pip list
argparse (1.2.1)
awscli (0.13.2)
bcdoc (0.9.0)
botocore (0.16.0)
colorama (0.2.5)
distribute (0.7.3)
docutils (0.11)
jmespath (0.0.2)
pip (1.4.1)
ply (3.4)
python-dateutil (2.1)
requests (1.2.0)
setuptools (1.1.3)
six (1.4.1)
```

```
$ pip install --upgrade awscli
Downloading/unpacking awscli from https://pypi.python.org/packages/source/a/awscli/awscli-1.0.0.tar.gz#md5=9a10b444647fed779417fba1f1603520
  Downloading awscli-1.0.0.tar.gz (113kB): 113kB downloaded
  Running setup.py egg_info for package awscli

Requirement already up-to-date: botocore>=0.16.0,<0.17.0 in ./.local/lib/python3.3/site-packages (from awscli)
Requirement already up-to-date: bcdoc>=0.9.0,<0.10.0 in /usr/lib/python3.3/site-packages (from awscli)
Requirement already up-to-date: six>=1.1.0 in ./.local/lib/python3.3/site-packages (from awscli)
Requirement already up-to-date: colorama==0.2.5 in /usr/lib/python3.3/site-packages (from awscli)
Requirement already up-to-date: argparse>=1.1 in /usr/lib/python3.3/site-packages (from awscli)
Requirement already up-to-date: docutils>=0.10 in /usr/lib/python3.3/site-packages (from awscli)
Downloading/unpacking rsa==3.1.1 (from awscli)
  Downloading rsa-3.1.1.tar.gz
  Running setup.py egg_info for package rsa
    Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.10.tar.gz
    Extracting in /tmp/tmpurm7u0
    Now working in /tmp/tmpurm7u0/distribute-0.6.10
    Building a Distribute egg in /tmp/pip_build_root/rsa
    RefactoringTool: Skipping implicit fixer: buffer
    RefactoringTool: Skipping implicit fixer: idioms
    RefactoringTool: Skipping implicit fixer: set_literal
    RefactoringTool: Skipping implicit fixer: ws_comma
    RefactoringTool: Refactored build/src/tests/api_tests.txt
    RefactoringTool: Files that were modified:
    RefactoringTool: build/src/tests/api_tests.txt
    --- build/src/tests/api_tests.txt   (original)
    +++ build/src/tests/api_tests.txt   (refactored)
    @@ -39,7 +39,7 @@
         >>> dist.py_version == sys.version[:3]
         True

    -    >>> print dist.platform
    +    >>> print(dist.platform)
         None

     Including various computed attributes::
    @@ -199,7 +199,7 @@
     You can ask a WorkingSet to ``find()`` a distribution matching a requirement::

         >>> from pkg_resources import Requirement
    -    >>> print ws.find(Requirement.parse("Foo==1.0"))    # no match, return None
    +    >>> print(ws.find(Requirement.parse("Foo==1.0")))    # no match, return None
         None

         >>> ws.find(Requirement.parse("Bar==0.9"))  # match, return distribution
    @@ -211,7 +211,7 @@
         >>> try:
         ...     ws.find(Requirement.parse("Bar==1.0"))
         ... except VersionConflict:
    -    ...     print 'ok'
    +    ...     print('ok')
         ok

     You can subscribe a callback function to receive notifications whenever a new
    @@ -219,7 +219,7 @@
     once for each existing distribution in the working set, and then is called
     again for new distributions added thereafter::

    -    >>> def added(dist): print "Added", dist
    +    >>> def added(dist): print("Added", dist)
         >>> ws.subscribe(added)
         Added Bar 0.9
         >>> foo12 = Distribution(project_name="Foo", version="1.2", location="f12")
    Skipping implicit fixer: buffer
    Skipping implicit fixer: idioms
    Skipping implicit fixer: set_literal
    Skipping implicit fixer: ws_comma
    /usr/lib/python3.3/distutils/dist.py:257: UserWarning: Unknown distribution option: 'entry_points'
      warnings.warn(msg)
    /usr/lib/python3.3/distutils/dist.py:257: UserWarning: Unknown distribution option: 'zip_safe'
      warnings.warn(msg)
    /usr/lib/python3.3/distutils/dist.py:257: UserWarning: Unknown distribution option: 'test_suite'
      warnings.warn(msg)
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help

    error: invalid command 'bdist_egg'
    /tmp/pip_build_root/rsa/distribute-0.6.10-py3.3.egg
    Traceback (most recent call last):
      File "./distribute_setup.py", line 143, in use_setuptools
        raise ImportError
    ImportError

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/tmp/pip_build_root/rsa/setup.py", line 5, in <module>
        use_setuptools('0.6.10')
      File "./distribute_setup.py", line 145, in use_setuptools
        return _do_download(version, download_base, to_dir, download_delay)
      File "./distribute_setup.py", line 125, in _do_download
        _build_egg(egg, tarball, to_dir)
      File "./distribute_setup.py", line 116, in _build_egg
        raise IOError('Could not build the egg.')
    OSError: Could not build the egg.
    Complete output from command python setup.py egg_info:
    Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.10.tar.gz

Extracting in /tmp/tmpurm7u0

Now working in /tmp/tmpurm7u0/distribute-0.6.10

Building a Distribute egg in /tmp/pip_build_root/rsa

creating build

creating build/src

creating build/src/docs

creating build/src/docs/_theme

creating build/src/docs/_theme/nature

creating build/src/docs/_theme/nature/static

creating build/src/docs/build

creating build/src/docs/build/html

creating build/src/docs/build/html/_sources

creating build/src/docs/build/html/_static

creating build/src/setuptools

creating build/src/setuptools/command

creating build/src/setuptools/tests

creating build/src/tests

creating build/src/tests/shlib_test

copying setuptools/archive_util.py -> build/src/setuptools

copying setuptools/__init__.py -> build/src/setuptools

copying setuptools/sandbox.py -> build/src/setuptools

copying setuptools/dist.py -> build/src/setuptools

copying setuptools/package_index.py -> build/src/setuptools

copying setuptools/depends.py -> build/src/setuptools

copying setuptools/extension.py -> build/src/setuptools

copying setuptools/tests/test_upload_docs.py -> build/src/setuptools/tests

copying setuptools/tests/__init__.py -> build/src/setuptools/tests

copying setuptools/tests/test_develop.py -> build/src/setuptools/tests

copying setuptools/tests/test_easy_install.py -> build/src/setuptools/tests

copying setuptools/tests/test_build_ext.py -> build/src/setuptools/tests

copying setuptools/tests/doctest.py -> build/src/setuptools/tests

copying setuptools/tests/test_packageindex.py -> build/src/setuptools/tests

copying setuptools/tests/test_sandbox.py -> build/src/setuptools/tests

copying setuptools/tests/test_resources.py -> build/src/setuptools/tests

copying setuptools/command/install.py -> build/src/setuptools/command

copying setuptools/command/build_py.py -> build/src/setuptools/command

copying setuptools/command/upload_docs.py -> build/src/setuptools/command

copying setuptools/command/develop.py -> build/src/setuptools/command

copying setuptools/command/install_egg_info.py -> build/src/setuptools/command

copying setuptools/command/__init__.py -> build/src/setuptools/command

copying setuptools/command/build_ext.py -> build/src/setuptools/command

copying setuptools/command/bdist_rpm.py -> build/src/setuptools/command

copying setuptools/command/test.py -> build/src/setuptools/command

copying setuptools/command/register.py -> build/src/setuptools/command

copying setuptools/command/upload.py -> build/src/setuptools/command

copying setuptools/command/bdist_egg.py -> build/src/setuptools/command

copying setuptools/command/install_lib.py -> build/src/setuptools/command

copying setuptools/command/egg_info.py -> build/src/setuptools/command

copying setuptools/command/easy_install.py -> build/src/setuptools/command

copying setuptools/command/setopt.py -> build/src/setuptools/command

copying setuptools/command/saveopts.py -> build/src/setuptools/command

copying setuptools/command/bdist_wininst.py -> build/src/setuptools/command

copying setuptools/command/sdist.py -> build/src/setuptools/command

copying setuptools/command/install_scripts.py -> build/src/setuptools/command

copying setuptools/command/alias.py -> build/src/setuptools/command

copying setuptools/command/rotate.py -> build/src/setuptools/command

copying setuptools/tests/win_script_wrapper.txt -> build/src/setuptools/tests

copying setuptools/cli.exe -> build/src/setuptools

copying setuptools/gui.exe -> build/src/setuptools

copying tests/test_distribute_setup.py -> build/src/tests

copying tests/install_test.py -> build/src/tests

copying tests/shlib_test/setup.py -> build/src/tests/shlib_test

copying tests/shlib_test/test_hello.py -> build/src/tests/shlib_test

copying tests/shlib_test/hello.c -> build/src/tests/shlib_test

copying tests/shlib_test/hellolib.c -> build/src/tests/shlib_test

copying tests/shlib_test/hello.pyx -> build/src/tests/shlib_test

copying tests/api_tests.txt -> build/src/tests

RefactoringTool: Skipping implicit fixer: buffer

RefactoringTool: Skipping implicit fixer: idioms

RefactoringTool: Skipping implicit fixer: set_literal

RefactoringTool: Skipping implicit fixer: ws_comma

RefactoringTool: Refactored build/src/tests/api_tests.txt

RefactoringTool: Files that were modified:

RefactoringTool: build/src/tests/api_tests.txt

--- build/src/tests/api_tests.txt   (original)

+++ build/src/tests/api_tests.txt   (refactored)

@@ -39,7 +39,7 @@

     >>> dist.py_version == sys.version[:3]

     True



-    >>> print dist.platform

+    >>> print(dist.platform)

     None



 Including various computed attributes::

@@ -199,7 +199,7 @@

 You can ask a WorkingSet to ``find()`` a distribution matching a requirement::



     >>> from pkg_resources import Requirement

-    >>> print ws.find(Requirement.parse("Foo==1.0"))    # no match, return None

+    >>> print(ws.find(Requirement.parse("Foo==1.0")))    # no match, return None

     None



     >>> ws.find(Requirement.parse("Bar==0.9"))  # match, return distribution

@@ -211,7 +211,7 @@

     >>> try:

     ...     ws.find(Requirement.parse("Bar==1.0"))

     ... except VersionConflict:

-    ...     print 'ok'

+    ...     print('ok')

     ok



 You can subscribe a callback function to receive notifications whenever a new

@@ -219,7 +219,7 @@

 once for each existing distribution in the working set, and then is called

 again for new distributions added thereafter::



-    >>> def added(dist): print "Added", dist

+    >>> def added(dist): print("Added", dist)

     >>> ws.subscribe(added)

     Added Bar 0.9

     >>> foo12 = Distribution(project_name="Foo", version="1.2", location="f12")

copying docs/conf.py -> build/src/docs

copying docs/setuptools.txt -> build/src/docs

copying docs/easy_install.txt -> build/src/docs

copying docs/python3.txt -> build/src/docs

copying docs/using.txt -> build/src/docs

copying docs/index.txt -> build/src/docs

copying docs/pkg_resources.txt -> build/src/docs

copying docs/roadmap.txt -> build/src/docs

copying docs/build/html/_sources/setuptools.txt -> build/src/docs/build/html/_sources

copying docs/build/html/_sources/easy_install.txt -> build/src/docs/build/html/_sources

copying docs/build/html/_sources/python3.txt -> build/src/docs/build/html/_sources

copying docs/build/html/_sources/using.txt -> build/src/docs/build/html/_sources

copying docs/build/html/_sources/index.txt -> build/src/docs/build/html/_sources

copying docs/build/html/_sources/pkg_resources.txt -> build/src/docs/build/html/_sources

copying docs/build/html/_sources/roadmap.txt -> build/src/docs/build/html/_sources

copying docs/_theme/nature/theme.conf -> build/src/docs/_theme/nature

copying docs/build/html/_static/nature.css -> build/src/docs/build/html/_static

copying docs/build/html/_static/pygments.css -> build/src/docs/build/html/_static

copying docs/build/html/_static/basic.css -> build/src/docs/build/html/_static

copying docs/_theme/nature/static/pygments.css -> build/src/docs/_theme/nature/static

copying docs/_theme/nature/static/nature.css_t -> build/src/docs/_theme/nature/static

copying docs/Makefile -> build/src/docs

copying pkg_resources.py -> build/src

copying distribute_setup.py -> build/src

copying site.py -> build/src

copying easy_install.py -> build/src

copying setup.py -> build/src

copying CHANGES.txt -> build/src

copying DEVGUIDE.txt -> build/src

copying CONTRIBUTORS.txt -> build/src

copying README.txt -> build/src

copying MANIFEST.in -> build/src

copying launcher.c -> build/src

Skipping implicit fixer: buffer

Skipping implicit fixer: idioms

Skipping implicit fixer: set_literal

Skipping implicit fixer: ws_comma

/usr/lib/python3.3/distutils/dist.py:257: UserWarning: Unknown distribution option: 'entry_points'

  warnings.warn(msg)

/usr/lib/python3.3/distutils/dist.py:257: UserWarning: Unknown distribution option: 'zip_safe'

  warnings.warn(msg)

/usr/lib/python3.3/distutils/dist.py:257: UserWarning: Unknown distribution option: 'test_suite'

  warnings.warn(msg)

usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]

   or: setup.py --help [cmd1 cmd2 ...]

   or: setup.py --help-commands

   or: setup.py cmd --help



error: invalid command 'bdist_egg'

/tmp/pip_build_root/rsa/distribute-0.6.10-py3.3.egg

Traceback (most recent call last):

  File "./distribute_setup.py", line 143, in use_setuptools

    raise ImportError

ImportError



During handling of the above exception, another exception occurred:



Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/tmp/pip_build_root/rsa/setup.py", line 5, in <module>

    use_setuptools('0.6.10')

  File "./distribute_setup.py", line 145, in use_setuptools

    return _do_download(version, download_base, to_dir, download_delay)

  File "./distribute_setup.py", line 125, in _do_download

    _build_egg(egg, tarball, to_dir)

  File "./distribute_setup.py", line 116, in _build_egg

    raise IOError('Could not build the egg.')

OSError: Could not build the egg.

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/rsa
Storing complete log in /root/.pip/pip.log
```

This is due to rsa (on which awscli depends) being pinned on distribute, and the rsa maintainer not having updated it since the distutils-setuptools merge.

https://bitbucket.org/sybren/python-rsa/issue/17/pip-install-fails-on-python3-with-newer


Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@
             'six>=1.1.0',
             'colorama==0.2.5',
             'docutils>=0.10',
-            'rsa==3.1.1']
+            'rsa==3.1.2']
 
 if sys.version_info[:2] == (2, 6):
     # For python2.6 we have to require argparse since it


Test patch: