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

cannot import helpers.embed_builder #22

Closed
Column01 opened this issue Dec 28, 2021 Discussed in #21 · 18 comments
Closed

cannot import helpers.embed_builder #22

Column01 opened this issue Dec 28, 2021 Discussed in #21 · 18 comments

Comments

@Column01
Copy link
Owner

Discussed in #21

Originally posted by davidavidavi123 December 28, 2021
um i just downloaded the bot, and trying to run it, but i get the error:
Initializing the command registry handler. This does not start registering commands!
Registering commands...
Traceback (most recent call last):
File "C:\Users\23740\Downloads\Discord-Moderation-Bot-master\Discord-Moderation-Bot-master\bot.py", line 154, in
bot = ModerationBot()
self.registry.register_commands()
File "C:\Users\23740\Downloads\Discord-Moderation-Bot-master\Discord-Moderation-Bot-master\command_registry.py", line 75, in register_commands
command_module = importlib.import_module("commands.{}".format(fname))
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2544.0_x64__qbz5n2kfra8p0\lib\importlib_init_.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in call_with_frames_removed
File "C:\Users\23740\Downloads\Discord-Moderation-Bot-master\Discord-Moderation-Bot-master\commands\ban.py", line 6, in
from helpers.embed_builder import EmbedBuilder
ModuleNotFoundError: No module named 'helpers.embed_builder'
PS C:\Users\23740\Downloads\Discord-Moderation-Bot-master\Discord-Moderation-Bot-master> python3 bot.py
Initializing the command registry handler. This does not start registering commands!
Registering commands...
Traceback (most recent call last):
File "C:\Users\23740\Downloads\Discord-Moderation-Bot-master\Discord-Moderation-Bot-master\bot.py", line 154, in
bot = ModerationBot()
File "C:\Users\23740\Downloads\Discord-Moderation-Bot-master\Discord-Moderation-Bot-master\bot.py", line 25, in init
self.registry.register_commands()
File "C:\Users\23740\Downloads\Discord-Moderation-Bot-master\Discord-Moderation-Bot-master\command_registry.py", line 75, in register_commands
command_module = importlib.import_module("commands.{}".format(fname))
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2544.0_x64__qbz5n2kfra8p0\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "C:\Users\23740\Downloads\Discord-Moderation-Bot-master\Discord-Moderation-Bot-master\commands\ban.py", line 6, in
from helpers.embed_builder import EmbedBuilder
ModuleNotFoundError: No module named 'helpers.embed_builder'
i think the helpers file is not importing correctly, pls help

@davidavidavi123
Copy link

hey

@Column01
Copy link
Owner Author

@davidavidavi123 I've not had this issue before. I suspect it has to do with either where you extracted it (in your downloads folder) or the fact you seem to be using python that was installed from the windows store. Please try putting it in your documents folder (so like Documents/Discord-Moderation-Bot and then the bot.py script should be in that folder, no sub folder) and try again. If that doesn't work, please try installing python manually, not from the windows store

@davidavidavi123
Copy link

oh i think i accidently overwrote the manually installed python with the windows python

@davidavidavi123
Copy link

yo how do you uninstall the windows store python? 🤣

@Column01
Copy link
Owner Author

I think you need to do it from the settings app. Add or remove programs

@davidavidavi123
Copy link

yo i installed python 3.10.1 and now it says python not found xd

@Column01
Copy link
Owner Author

you will need to add it to your path variables to use it in the command prompt. It was an option when you installed it... might need to google it now

@davidavidavi123
Copy link

oh im trying to run it in visual studios terminal

@davidavidavi123
Copy link

should i uninstall and install again

@Column01
Copy link
Owner Author

No just look up how to add it to your PATH

@davidavidavi123
Copy link

i already uninstalled and installed with the path option

@davidavidavi123
Copy link

davidavidavi123 commented Dec 28, 2021

it still says python not found do i restart my pc

@Column01
Copy link
Owner Author

Restart Visual studio

@davidavidavi123
Copy link

i alreaady did multiple times

@Column01
Copy link
Owner Author

ok try rebooting your computer then

@davidavidavi123
Copy link

k it works now but i got another error
Traceback (most recent call last):
File "C:\Users\23740\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "C:\Users\23740\AppData\Local\Programs\Python\Python310\lib\asyncio\coroutines.py", line 136, in coro
res = yield from await_meth()
File "C:\Users\23740\Documents\Discord-Moderation-Bot-master\bot.py", line 60, in event_template
await handler.handle(*args, **kwargs)
File "C:\Users\23740\Documents\Discord-Moderation-Bot-master\events\ready.py", line 17, in handle
await self.client.storage.init()
File "C:\Users\23740\Documents\Discord-Moderation-Bot-master\storage_management.py", line 17, in init
await self.create_file()
File "C:\Users\23740\Documents\Discord-Moderation-Bot-master\storage_management.py", line 57, in create_file
with open(self.settings_file_path, "w+") as w:
AttributeError: 'StorageManagement' object has no attribute 'settings_file_path'

@Column01
Copy link
Owner Author

OK that's a genuine error, let me fix it real quick

@Column01
Copy link
Owner Author

Redownload the repository (or better yet setup git so you could just pull the changes easily) and it should work

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