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

ModuleNotFoundError: No module named 'config' #23

Closed
masonjeffers opened this issue Apr 26, 2023 · 3 comments
Closed

ModuleNotFoundError: No module named 'config' #23

masonjeffers opened this issue Apr 26, 2023 · 3 comments

Comments

@masonjeffers
Copy link

I'm following the directions in Readme.md

When I enter:
python3 utils/chatgpt.py

I get:
Traceback (most recent call last):
File "/home/user/tools/PentestGPT/utils/chatgpt.py", line 13, in
import config.chatgpt_config
ModuleNotFoundError: No module named 'config'

@GreyDGL
Copy link
Owner

GreyDGL commented Apr 26, 2023

Hi there, I update the repo a little bit. The problem is because Python use a relative dependency between packages, which causes some troubles.
Please pull the latest repo again, setup the cookie, and try "python3 test_connection.py` to see if it works.

@Mohannadcse
Copy link

Mohannadcse commented Apr 26, 2023

I think the problem comes from this line **from config.chatgpt_config import ChatGPTConfig**, but there is no chatgpt_config file, because it's not pushed as it's listed in the .gitignore.
so what should be done here is just modifying the line from config.chatgpt_config import ChatGPTConfig to from config.chatgpt_config_sample import ChatGPTConfig

Here is the patch file to fix the problem
fix_config.patch

@GreyDGL
Copy link
Owner

GreyDGL commented Apr 26, 2023

@Mohannadcse Please read the documentation carefully and follow the installation guidance. You should copy chatgpt_config_sample to chatgpt_config instead of renaming them directly, in case that you accidentally upload your tokens to github.

@GreyDGL GreyDGL closed this as completed Apr 26, 2023
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

3 participants