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

ImportError: Cannot import name OpenAI from openai in sploitscan.py #35

Closed
svend3v opened this issue Nov 26, 2024 · 1 comment
Closed

Comments

@svend3v
Copy link

svend3v commented Nov 26, 2024

When attempting to run sploitscan.py with a specific CVE identifier, an ImportError is raised due to the incorrect import statement for the OpenAI library.

Reproduce
Clone the Repository

git clone https://github.com/sploitscan/sploitscan.git
cd sploitscan

Install Dependencies
pip install -r requirements.txt

Run the script
python3 sploitscan/sploitscan.py CVE-2024-49046

Expected Behavior
The script should execute without errors and perform the intended scan based on the provided CVE identifier.

Actual Behavior
An ImportError is raised indicating that the name OpenAI cannot be imported from the openai module.

Error Traceback

Traceback (most recent call last):
  File "sploitscan/sploitscan.py", line 16, in <module>
    from openai import OpenAI
ImportError: cannot import name 'OpenAI' from 'openai' (/path/to/python/site-packages/openai/__init__.py)

Cause
The error ccurs because the openai library does not have a class or function named OpenAI that can be directly imported. Instead, the correct usage is to import the openai module itself and then access its functionalities.

Solution
Modify the import statement in sploitscan/sploitscan.py

from:
from openai import OpenAI

to:
import openai

@xaitax
Copy link
Owner

xaitax commented Nov 28, 2024

Hi,

thanks @svend3v .

Please just run:

python3 sploitscan.py CVE-2024-49046

@xaitax xaitax closed this as completed Jan 20, 2025
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