lebinh/ngxtop

SyntaxError: invalid syntax

shutdownslz opened this issue · 1 comments

# pip install ngxtop
/usr/lib/python2.6/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
You are using pip version 7.1.0, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting ngxtop
Downloading http://mirrors.tencentyun.com/pypi/packages/c7/20/9aafbe173b596dfbc996f1b8b957da88d160cf1c5279179d3b4990f40e00/ngxtop-0.0.2-py2.py3-none-any.whl
Collecting tabulate (from ngxtop)
Downloading http://mirrors.tencentyun.com/pypi/packages/57/6f/213d075ad03c84991d44e63b6516dd7d185091df5e1d02a660874f8f7e1e/tabulate-0.8.7.tar.gz (50kB)
100% |████████████████████████████████| 53kB 538kB/s
Collecting docopt (from ngxtop)
Downloading http://mirrors.tencentyun.com/pypi/packages/a2/55/8f8cab2afd404cf578136ef2cc5dfb50baa1761b68c9da1fb1e4eed343c9/docopt-0.6.2.tar.gz
Collecting pyparsing (from ngxtop)
Downloading http://mirrors.tencentyun.com/pypi/packages/8a/bb/488841f56197b13700afd5658fc279a2025a39e22449b7cf29864669b15d/pyparsing-2.4.7-py2.py3-none-any.whl (67kB)
100% |████████████████████████████████| 69kB 555kB/s
Installing collected packages: tabulate, docopt, pyparsing, ngxtop
Running setup.py install for tabulate
Running setup.py install for docopt
Successfully installed docopt-0.6.2 ngxtop-0.0.2 pyparsing-2.4.7 tabulate-0.8.7

# python --version
Python 2.6.6
# pip --version
pip 7.1.0 from /usr/lib/python2.6/site-packages (python 2.6)

**But, when I run ngxtop:

ngxtop -l /web/webserver/nginx/logs/access.log**

Traceback (most recent call last):
File "/usr/bin/ngxtop", line 7, in
from ngxtop.ngxtop import main
File "/usr/lib/python2.6/site-packages/ngxtop/ngxtop.py", line 77, in
from config_parser import detect_log_config, detect_config_path, extract_variables, build_pattern
File "/usr/lib/python2.6/site-packages/ngxtop/config_parser.py", line 8, in
from pyparsing import Literal, Word, ZeroOrMore, OneOrMore, Group,
File "/usr/lib/python2.6/site-packages/pyparsing.py", line 6897
name: getattr(diag, name) for name in diag._all_names

My system informations : ^

uname -r

2.6.32-696.el6.x86_64

cat /etc/redhat-release

CentOS release 6.9 (Final)

Use Pyparsing 2.4.2 version ,it work