jorgebastida / awslogs

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

How to run a awslogs installed by pip on windows? #375

Open eliaweiss opened 2 years ago

eliaweiss commented 2 years ago

I installed awslogs https://github.com/jorgebastida/awslogs

When I try to run it I get awslogs : The term 'awslogs' is not recognized as the name of a cmdlet, function, script file, or operable program.

I couldn't find any info on how to actually run a cmd that was installed by pip on windows,

When searching the web i could only find info about how to install a pip cmd but not how to run a cmd install by pip

More info:

pip show --files awslogs Name: awslogs Version: 0.14.0 Summary: awslogs is a simple command line tool to read aws cloudwatch logs. Home-page: https://github.com/jorgebastida/awslogs Author: Jorge Bastida Author-email: me@jorgebastida.com License: BSD Location: c:\python310\lib\site-packages Requires: boto3, jmespath, python-dateutil, termcolor Required-by: Files: awslogs-0.14.0.dist-info\AUTHORS awslogs-0.14.0.dist-info\COPYING awslogs-0.14.0.dist-info\METADATA awslogs-0.14.0.dist-info\RECORD awslogs-0.14.0.dist-info\WHEEL awslogs-0.14.0.dist-info\entry_points.txt awslogs-0.14.0.dist-info\top_level.txt awslogs__init.py awslogs_version.py awslogs\bin.py awslogs\core.py awslogs\exceptions.py tests\init__.py tests\test_it.py tests\test_versions.py

pip awslogs ERROR: unknown command "awslogs"

py.exe C:\Python310\Lib\site-packages\awslogs\ C:\Python310\python.exe: can't find 'main' module in 'C:\Python310\Lib\site-packages\awslogs\'

py.exe C:\Python310\Lib\site-packages\awslogs\bin.py Traceback (most recent call last): File "C:\Python310\Lib\site-packages\awslogs\bin.py", line 9, in from . import exceptions ImportError: attempted relative import with no known parent package

see https://stackoverflow.com/questions/73149088/how-to-run-a-cmd-installed-by-pip-on-windows?noredirect=1#comment129197513_73149088

DeflateAwning commented 1 year ago

Same issue.

Reproduction:

  1. On windows, install via python3 -m pip install awslogs.
  2. Run via python3 -m awslogs -h. Observe this error:
python.exe: No module named awslogs.__main__; 'awslogs' is a package and cannot be directly executed