tenable / pyTenable

Python Library for interfacing into Tenable's platform APIs
https://pytenable.readthedocs.io
MIT License
354 stars 173 forks source link

Issue with "from .base import SCEndpoint" #627

Closed mthakk3793 closed 2 years ago

mthakk3793 commented 2 years ago

For Tenable.SC, working on pytenable I have been having issues with the import that was recommended on the tenable.sc documentation. One of the imports is "from .base import SCEndpoint, SCResultsIterator". I am getting the error : "ImportError: attempted relative import with no known parent package." Can someone please explain how I bypass this? I don't know if I need some sort of pip install or update, but I cannot find a solution after searching for hours.

ChadKlunck commented 2 years ago

The from .base import statement is used internally by the pyTenable package, and probably isn't what you're looking for.

For basic Tenable.sc tasks, importing TenableSC is normally enough:

from tenable.sc import TenableSC
sc = TenableSC(hostname, access_key, secret_key)

# Do stuff with the 'sc' object, such as:
vulns = sc.analysis.vulns(('pluginID', '=', '19506'))