Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Needs to be update the tabulate on python 3.10 #13

Open
miszterx opened this issue Feb 6, 2023 · 1 comment
Open

Needs to be update the tabulate on python 3.10 #13

miszterx opened this issue Feb 6, 2023 · 1 comment

Comments

@miszterx
Copy link

miszterx commented Feb 6, 2023

Hi,

If somebody is still using this, and needs to use python 3.10, then this will popup:

python3 ./securityheaders.py                                                                                                                                                  ─╯
Traceback (most recent call last):
  File "/root/securityheaders/./securityheaders.py", line 6, in <module>
    import securityheaders.command_line
  File "/root/securityheaders/securityheaders/__init__.py", line 11, in <module>
    from .securityheader import SecurityHeaders
  File "/root/securityheaders/securityheaders/securityheader.py", line 22, in <module>
    from securityheaders.formatters import FindingFormatterFactory
  File "/root/securityheaders/securityheaders/formatters/__init__.py", line 1, in <module>
    from .findingformatterfactory import FindingFormatterFactory, FindingFormatter, FindingFormatterTabulated, FindingFormatterCSV
  File "/root/securityheaders/securityheaders/formatters/findingformatterfactory.py", line 5, in <module>
    from tabulate import tabulate
  File "/usr/local/lib/python3.10/dist-packages/tabulate.py", line 16, in <module>
    from collections import Iterable
ImportError: cannot import name 'Iterable' from 'collections' (/usr/lib/python3.10/collections/__init__.py)

You needs to update the requirements.txt and install tabulate 0.9.0. It fix the problem:

diff --git a/requirements.txt b/requirements.txt
index 6b25e6e..41a1b17 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -3,4 +3,4 @@ argcomplete==1.9.4
 enum34==1.1.6
 ipaddress==1.0.22
 six==1.11.0
-tabulate==0.8.2
+tabulate==0.9.0
pip install -r requirements.txt                                                                                                                                               ─╯
Requirement already satisfied: anytree==2.4.3 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 1)) (2.4.3)
Requirement already satisfied: argcomplete==1.9.4 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 2)) (1.9.4)
Requirement already satisfied: enum34==1.1.6 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 3)) (1.1.6)
Requirement already satisfied: ipaddress==1.0.22 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 4)) (1.0.22)
Requirement already satisfied: six==1.11.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 5)) (1.11.0)
Collecting tabulate==0.9.0
  Downloading tabulate-0.9.0-py3-none-any.whl (35 kB)
Installing collected packages: tabulate
  Attempting uninstall: tabulate
    Found existing installation: tabulate 0.8.5
    Uninstalling tabulate-0.8.5:
      Successfully uninstalled tabulate-0.8.5
Successfully installed tabulate-0.9.0
python ./securityheaders.py                                                                                                                                                   ─╯
usage: securityheaders.py [-h] [--listcheckers] [--listformatters] [--listheaders] [--headers HEADERS] [--response RESPONSE] [--defaultscheme https] [--max-redirects 2]
                          [--config ./conf/app.conf] [--urlcolumn 0] [--startrow 0] [--screen] [--file ./tmp] [--formatter Tabulate] [--flatten]
                          [--skipcheckers [checkername ...]] [--checkers [Checker ...]]
                          [URL ...]
@Miesvanderlippe
Copy link
Contributor

Miesvanderlippe commented Apr 17, 2023

I partially fixed this in this commit:
5410803

I guess we should explicitly install > 0.9 for systems which have existing installations of tabulate 0.8.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants