jorgebastida / awslogs

AWS CloudWatch logs for Humans™
Other
4.86k stars 336 forks source link

after brew install: ModuleNotFoundError: No module named 'six' #397

Closed ronkorving closed 1 year ago

ronkorving commented 1 year ago

I used Homebrew to install as instructed in the readme, and the moment I run awslogs, I get an import error:

Traceback (most recent call last):
  File "/opt/homebrew/bin/awslogs", line 5, in <module>
    from awslogs.bin import main
  File "/opt/homebrew/Cellar/awslogs/0.14.0_5/libexec/lib/python3.12/site-packages/awslogs/__init__.py", line 2, in <module>
    from .core import AWSLogs  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/awslogs/0.14.0_5/libexec/lib/python3.12/site-packages/awslogs/core.py", line 9, in <module>
    import boto3
  File "/opt/homebrew/Cellar/awslogs/0.14.0_5/libexec/lib/python3.12/site-packages/boto3/__init__.py", line 17, in <module>
    from boto3.session import Session
  File "/opt/homebrew/Cellar/awslogs/0.14.0_5/libexec/lib/python3.12/site-packages/boto3/session.py", line 17, in <module>
    import botocore.session
  File "/opt/homebrew/Cellar/awslogs/0.14.0_5/libexec/lib/python3.12/site-packages/botocore/session.py", line 26, in <module>
    import botocore.client
  File "/opt/homebrew/Cellar/awslogs/0.14.0_5/libexec/lib/python3.12/site-packages/botocore/client.py", line 15, in <module>
    from botocore import waiter, xform_name
  File "/opt/homebrew/Cellar/awslogs/0.14.0_5/libexec/lib/python3.12/site-packages/botocore/waiter.py", line 18, in <module>
    from botocore.docs.docstring import WaiterDocstring
  File "/opt/homebrew/Cellar/awslogs/0.14.0_5/libexec/lib/python3.12/site-packages/botocore/docs/__init__.py", line 15, in <module>
    from botocore.docs.service import ServiceDocumenter
  File "/opt/homebrew/Cellar/awslogs/0.14.0_5/libexec/lib/python3.12/site-packages/botocore/docs/service.py", line 13, in <module>
    from botocore.docs.bcdoc.restdoc import DocumentStructure
  File "/opt/homebrew/Cellar/awslogs/0.14.0_5/libexec/lib/python3.12/site-packages/botocore/docs/bcdoc/restdoc.py", line 17, in <module>
    from botocore.compat import OrderedDict
  File "/opt/homebrew/Cellar/awslogs/0.14.0_5/libexec/lib/python3.12/site-packages/botocore/compat.py", line 31, in <module>
    from dateutil.tz import tzlocal
  File "/opt/homebrew/Cellar/awslogs/0.14.0_5/libexec/lib/python3.12/site-packages/dateutil/tz/__init__.py", line 2, in <module>
    from .tz import *
  File "/opt/homebrew/Cellar/awslogs/0.14.0_5/libexec/lib/python3.12/site-packages/dateutil/tz/tz.py", line 19, in <module>
    import six
ModuleNotFoundError: No module named 'six'
ronkorving commented 1 year ago

I tried installing it using pip install awslogs --ignore-installed six which did work on Python 3.11. It does fail on Python 3.12 however:

Traceback (most recent call last):
  File "/Users/Ron/.pyenv/versions/3.12.0/bin/awslogs", line 5, in <module>
    from awslogs.bin import main
  File "/Users/Ron/.pyenv/versions/3.12.0/lib/python3.12/site-packages/awslogs/__init__.py", line 1, in <module>
    from ._version import __version__  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Ron/.pyenv/versions/3.12.0/lib/python3.12/site-packages/awslogs/_version.py", line 1, in <module>
    from pkg_resources import get_distribution
ModuleNotFoundError: No module named 'pkg_resources'
tvalenta commented 1 year ago

I think if you run brew install six it will get the updated version that includes Python3.12 support. A fix would need to be in the Homebrew Formula and not this repo.

ronkorving commented 1 year ago

@tvalenta Could you direct me to where the Homebrew Formula lives so I can report it there?

tvalenta commented 1 year ago

@ronkorving https://github.com/Homebrew/homebrew-core/issues/151657 is similar to what you observed

ronkorving commented 1 year ago

I guess I'll close this ticket then.