Skip to content
Advertisement

Traceback (most recent call last): File “”, line 1, in ModuleNotFoundError: No module named ‘Webhook’

I installed dhooks on Windows with the command:

pip install dhooks

but when it is executed it shows this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'Webhook'

THIS IS MY CODE BELOW:

from dhooks import Webhook, Embed

hook = Webhook('https://discord.com/api/webhooks/22892770896038952/ao--vUV18I_DiZCmM50SifYeGpH-sC3AYKuqtVnEE')

embed = Embed(
    description='This is the **description** of the embed! :smiley:',
    color=0x5CDBF0,
    timestamp='now'  # sets the timestamp to current time
    )

image1 = 'https://i.imgur.com/rdm3W9t.png'
image2 = 'https://i.imgur.com/f1LOr4q.png'

embed.set_author(name='Author Goes Here', icon_url=image1)
embed.add_field(name='Test Field', value='Value of the field :open_mouth:')
embed.add_field(name='Another Field', value='1234 :smile:')
embed.set_footer(text='Here is my footer text', icon_url=image1)

embed.set_thumbnail(image1)
embed.set_image(image2)

hook.send(embed=embed)
---------------------------------------------

**when I execute it gives the above error...**

> python bot.py

```Traceback (most recent call last):
  File "C:Usersuser52Desktopbotbot.py", line 1, in <module>
    from dhooks import Webhook, Embed
  File "C:Python32libsite-packagesdhooks__init__.py", line 1, in <module>
    from .client import Webhook
  File "C:Python32libsite-packagesdhooksclient.py", line 3, in <module>
    import aiohttp
  File "C:Python32libsite-packagesaiohttp__init__.py", line 6, in <module>
    from .client import (
  File "C:Python32libsite-packagesaiohttpclient.py", line 3, in <module>
    import asyncio
  File "C:Python32libasyncio__init__.py", line 8, in <module>
    from .base_events import *
  File "C:Python32libasynciobase_events.py", line 39, in <module>
    from . import coroutines
  File "C:Python32libasynciocoroutines.py", line 5, in <module>
    import inspect
  File "C:Python32libinspect.py", line 36, in <module>
    import bot
  File "C:Usersuser52Desktopbotbot.py", line 1, in <module>
    from dhooks import Webhook, Embed
ImportError: cannot import name 'Webhook' from partially initialized module 'dhooks' (most likely due to a circular import) (C:Python32libsite-packagesdhooks__init__.py)```

Wondering someone will help.

Advertisement

Answer

pip install Webhook

Install that first and then the module you want

If the above doesn’t work ,use

pip install webhooks

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement