简体   繁体   English

Traceback(最近一次调用最后一次):文件“<stdin> ”,第 1 行,在<module> ModuleNotFoundError:没有名为“Webhook”的模块</module></stdin>

[英]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.

相关问题 追溯(最近一次通话):“文件” <stdin> ”,第1行,在 <module> - Traceback (most recent call last): File “<stdin>”, line 1, in <module> 为什么“回溯(最近一次通话最后一次):文件”<stdin> ”,第 1 行,在<module> ImportError:当我尝试安装 django 时,没有名为 django 的模块?</module></stdin> - why 'Traceback (most recent call last): File “<stdin>”, line 1, in <module> ImportError: No module named django' when im trying to install django? Traceback(最近一次通话最后一次):文件“<stdin> &quot;,第 1 行,在<module> TypeError: object() 没有参数 - Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: object() takes no parameters 获取回溯(最近一次调用最后一次):文件“<stdin> &quot;,第 1 行,在<module> NameError:名称“文件名”未定义 - Getting Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'filename' is not defined 回溯(最近调用最后):文件“<stdin> ",第 1 行,在<module> NameError: 名称 'db' 未定义</module></stdin> - Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'db' is not defined 我可以逃避此错误回溯(最近一次通话是最近一次):“文件” <stdin> ”,第1行,在 <module> 档案“ <stdin> ”,第2行,在data_entry中 - can i escape this error Traceback (most recent call last): File “<stdin>”, line 1, in <module> File “<stdin>”, line 2, in data_entry 无法在python 3Traceback(最近一次调用为最新)中找出此错误:“文件” <stdin> ”,第1行,在 <module> NameError:未定义名称“ xlrd” - Cannot figure out this error in python 3Traceback (most recent call last): File “<stdin>”, line 1, in <module> NameError: name 'xlrd' is not defined 追溯(最近一次呼叫最近):AttributeError:文件“”,第1行,模块“ socket”没有属性“ close” - Traceback (most recent call last): File “”, line 1, in AttributeError: module 'socket' has no attribute 'close' 回溯(最近一次调用最后一次):文件“main.py”,第 11 行,在<module> - Traceback (most recent call last): File "main.py", line 11, in <module> 回溯(最近一次调用最后一次):文件“D:\\Python\\PLAY.PY”,第 29 行,在<module> - Traceback (most recent call last): File "D:\Python\PLAY.PY", line 29, in <module>
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM