ModuleNotFoundError:没有名为“discord.commands.__init__.context”的模块;
我目前正在开发一个使用不和谐命令控制我的电脑的程序。对于不和谐库,我使用 Pycord。将文件转换为可执行文件后,显示错误:
Traceback (most recent call last):
File "main.py", line 1, in <module>
File "PyInstaller\loader\pyimod03.py", line 495, in exec_module
File "discord\__init__.py", line 33, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 495 in exec_module
File "discord\commands\__init__.py", line 26, in <module>
ModuleNotFoundError: No module named 'discord.commands.__init__.context'
[16680] Failed to execute script 'main' due to unhandled exception
I'm currently working on a program that controls my PC with discord commands. For discord library, I use Pycord. After converting the file into an Executable file, it shows the error:
Traceback (most recent call last):
File "main.py", line 1, in <module>
File "PyInstaller\loader\pyimod03.py", line 495, in exec_module
File "discord\__init__.py", line 33, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 495 in exec_module
File "discord\commands\__init__.py", line 26, in <module>
ModuleNotFoundError: No module named 'discord.commands.__init__.context'
[16680] Failed to execute script 'main' due to unhandled exception
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了同样的问题,这对我有用:
然后:
我安装了与 Discord 相关的不同库,所以我认为这就是问题 <3
I had the same issue and this worked for me:
Then:
I had installed a different library related to Discord, so I think that was the issue <3