[英]Traceback (most recent call last): File “<stdin>”, line 1, in <module> ModuleNotFoundError: No module named 'Webhook'
I installed dhooks
on Windows with the command:我使用以下命令在 Windows 上安装了dhooks
:
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:\Users\user52\Desktop\bot\bot.py", line 1, in <module>
from dhooks import Webhook, Embed
File "C:\Python32\lib\site-packages\dhooks\__init__.py", line 1, in <module>
from .client import Webhook
File "C:\Python32\lib\site-packages\dhooks\client.py", line 3, in <module>
import aiohttp
File "C:\Python32\lib\site-packages\aiohttp\__init__.py", line 6, in <module>
from .client import (
File "C:\Python32\lib\site-packages\aiohttp\client.py", line 3, in <module>
import asyncio
File "C:\Python32\lib\asyncio\__init__.py", line 8, in <module>
from .base_events import *
File "C:\Python32\lib\asyncio\base_events.py", line 39, in <module>
from . import coroutines
File "C:\Python32\lib\asyncio\coroutines.py", line 5, in <module>
import inspect
File "C:\Python32\lib\inspect.py", line 36, in <module>
import bot
File "C:\Users\user52\Desktop\bot\bot.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:\Python32\lib\site-packages\dhooks\__init__.py)```
Wondering someone will help.
pip install Webhook
Install that first and then the module you want先安装,再安装你想要的模块
If the above doesn't work,use如果上述方法不起作用,请使用
pip install webhooks
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.