TheGroundZero / openvasreporting

OpenVAS Reporting: Convert OpenVAS XML report files to reports
Other
131 stars 45 forks source link

ImportError: attempted relative import with no known parent package #14

Closed solidusIT closed 4 years ago

solidusIT commented 4 years ago

Hello, I am running Greenbone Security Assistant : Version 7.0.3. Latest version of openvasreporting. When running the following command : python3 openvasreporting.py -i openvasreport.xml -f xlsx I get :
Traceback (most recent call last): File "openvasreporting.py", line 9, in from .libs.config import Config ImportError: attempted relative import with no known parent package

Any idea? Thanks, Klaas

TheGroundZero commented 4 years ago

Please note that the tool must be loaded as a module (-m)

See the README

# When working from the Git repo
python3 -m openvasreporting -i [OpenVAS xml file(s)] [-o [Output file]] [-f [Output format]] [-l [minimal threat level (n, l, m, h, c)]] [-t [docx template]]
solidusIT commented 4 years ago

Tried repo with -m still got errors so I installed the pip package.

Installed the pip package but still getting errors: root@server:~/Downloads# openvasreporting -i openvasreport.xml -o openvas_report -f xslsx

Traceback (most recent call last): File "/usr/local/bin/openvasreporting", line 5, in from openvasreporting import main ImportError: cannot import name 'main' from 'openvasreporting' (/usr/local/lib/python3.8/dist-packages/openvasreporting/init.py)

TheGroundZero commented 4 years ago

As mentioned in the README, there's an issue with the pip installation version. See #4.
So don't use the pip install version, only the git repo version.

git clone https://github.com/TheGroundZero/openvasreporting.git
cd openvasreporting
python3 -m openvasreporting -i openvasreport.xml -o openvas_report -f xslsx
solidusIT commented 4 years ago

Followed your instruction. Still got errors. So I went through the other open issues and found the solution in ; https://github.com/TheGroundZero/openvasreporting/issues/9. (Last post) So now I can create some nice looking reports. Thanks