Netflix-Skunkworks / aardvark

Aardvark is a multi-account AWS IAM Access Advisor API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Syntax Error more_itertools

Recodify opened this issue · comments

commented

Running using Python2.7 (which I think is the target version of aardvark?)

Using the instructions on the readme, upon running aardvark config I received the following error:

(aardvark) sam@blah:~/code/aardvark$ aardvark config
Traceback (most recent call last):
  File "/home/sam/code/aardvark/bin/aardvark", line 11, in <module>
    load_entry_point('aardvark', 'console_scripts', 'aardvark')()
  File "/home/sam/code/aardvark/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/sam/code/aardvark/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/home/sam/code/aardvark/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/home/sam/code/aardvark/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/sam/code/aardvark/aardvark/__init__.py", line 9, in <module>
    from flasgger import Swagger
  File "/home/sam/code/aardvark/local/lib/python2.7/site-packages/flasgger-0.6.3-py2.7.egg/flasgger/__init__.py", line 7, in <module>
    from jsonschema import ValidationError  # noqa
  File "/home/sam/code/aardvark/local/lib/python2.7/site-packages/jsonschema-3.1.1-py2.7.egg/jsonschema/__init__.py", line 31, in <module>
    import importlib_metadata
  File "/home/sam/code/aardvark/local/lib/python2.7/site-packages/importlib_metadata-0.23-py2.7.egg/importlib_metadata/__init__.py", line 9, in <module>
    import zipp
  File "/home/sam/code/aardvark/local/lib/python2.7/site-packages/zipp-0.6.0-py2.7.egg/zipp.py", line 12, in <module>
    import more_itertools
  File "build/bdist.linux-x86_64/egg/more_itertools/__init__.py", line 1, in <module>
  File "/home/sam/code/aardvark/local/lib/python2.7/site-packages/more_itertools-7.2.0-py2.7.egg/more_itertools/more.py", line 340
    def _collate(*iterables, key=lambda a: a, reverse=False):
                               ^
SyntaxError: invalid syntax

This is due to moreitertools no longer supporting py2 as of version 5.0.0. The version installed via setup.py is 7.2.0.

The solution is simple: pip install more-itertools==5.0.0

Might be worth getting this pinned.

Sounds good, can you submit a PR for this please?

I believe this issue is resolved now that Aardvark has been moved to Py3. Feel free to reopen if you still have problems.