tenable / pyTenable

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

No module named 'tenable' #231

Closed cybercitizen7 closed 4 years ago

cybercitizen7 commented 4 years ago

Hey guys,

I am trying to setup my environment to use PyTenable for interacting with TenableIO through API.

I used pip install pytenableto install the library package as per instructions on the main page of this GitHub repository.

Then I simply tried the example also listed on the GitHub profile, just to test if it works.

from tenable.io import TenableIO

tio = TenableIO('Secret', 'Secret')

vulns = tio.exports.vulns()
for vuln in vulns:
    print(vuln)

However, I receive an error: No module named 'tenable'on the from tenable.io import TenableIO

I am using Python 3.7.2. and I do not have conflicting versions of Python nor do I use any virtualenv.

I do not understand why it is bothered with tenablemodule as I do not use that keyword anywhere in script.

cybercitizen7 commented 4 years ago

Ah, I will close this issue as I found out the problem. I am using Visual Studio Code's python interpretor and selecting 'Run Active File' it tries to execute Python file via CMD. When I explicitly said python _name_of_pythonfile.py then it worked.