I installed dhooks
on Windows with the command:
JavaScript
x
2
1
pip install dhooks
2
but when it is executed it shows this error:
JavaScript
1
4
1
Traceback (most recent call last):
2
File "<stdin>", line 1, in <module>
3
ModuleNotFoundError: No module named 'Webhook'
4
THIS IS MY CODE BELOW:
JavaScript
1
23
23
1
from dhooks import Webhook, Embed
2
3
hook = Webhook('https://discord.com/api/webhooks/22892770896038952/ao--vUV18I_DiZCmM50SifYeGpH-sC3AYKuqtVnEE')
4
5
embed = Embed(
6
description='This is the **description** of the embed! :smiley:',
7
color=0x5CDBF0,
8
timestamp='now' # sets the timestamp to current time
9
)
10
11
image1 = 'https://i.imgur.com/rdm3W9t.png'
12
image2 = 'https://i.imgur.com/f1LOr4q.png'
13
14
embed.set_author(name='Author Goes Here', icon_url=image1)
15
embed.add_field(name='Test Field', value='Value of the field :open_mouth:')
16
embed.add_field(name='Another Field', value='1234 :smile:')
17
embed.set_footer(text='Here is my footer text', icon_url=image1)
18
19
embed.set_thumbnail(image1)
20
embed.set_image(image2)
21
22
hook.send(embed=embed)
23
JavaScript
1
31
31
1
---------------------------------------------
2
3
**when I execute it gives the above error**
4
5
> python bot.py
6
7
```Traceback (most recent call last):
8
File "C:Usersuser52Desktopbotbot.py", line 1, in <module>
9
from dhooks import Webhook, Embed
10
File "C:Python32libsite-packagesdhooks__init__.py", line 1, in <module>
11
from .client import Webhook
12
File "C:Python32libsite-packagesdhooksclient.py", line 3, in <module>
13
import aiohttp
14
File "C:Python32libsite-packagesaiohttp__init__.py", line 6, in <module>
15
from .client import (
16
File "C:Python32libsite-packagesaiohttpclient.py", line 3, in <module>
17
import asyncio
18
File "C:Python32libasyncio__init__.py", line 8, in <module>
19
from .base_events import *
20
File "C:Python32libasynciobase_events.py", line 39, in <module>
21
from . import coroutines
22
File "C:Python32libasynciocoroutines.py", line 5, in <module>
23
import inspect
24
File "C:Python32libinspect.py", line 36, in <module>
25
import bot
26
File "C:Usersuser52Desktopbotbot.py", line 1, in <module>
27
from dhooks import Webhook, Embed
28
ImportError: cannot import name 'Webhook' from partially initialized module 'dhooks' (most likely due to a circular import) (C:Python32libsite-packagesdhooks__init__.py)```
29
30
Wondering someone will help.
31
Advertisement
Answer
pip install Webhook
Install that first and then the module you want
If the above doesn’t work ,use
pip install webhooks