久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <legend id='ZXaHo'><style id='ZXaHo'><dir id='ZXaHo'><q id='ZXaHo'></q></dir></style></legend>

        <bdo id='ZXaHo'></bdo><ul id='ZXaHo'></ul>
      <tfoot id='ZXaHo'></tfoot>
    1. <small id='ZXaHo'></small><noframes id='ZXaHo'>

        <i id='ZXaHo'><tr id='ZXaHo'><dt id='ZXaHo'><q id='ZXaHo'><span id='ZXaHo'><b id='ZXaHo'><form id='ZXaHo'><ins id='ZXaHo'></ins><ul id='ZXaHo'></ul><sub id='ZXaHo'></sub></form><legend id='ZXaHo'></legend><bdo id='ZXaHo'><pre id='ZXaHo'><center id='ZXaHo'></center></pre></bdo></b><th id='ZXaHo'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ZXaHo'><tfoot id='ZXaHo'></tfoot><dl id='ZXaHo'><fieldset id='ZXaHo'></fieldset></dl></div>
      1. ModuleNotFoundError:沒有名為“cogs"的模塊

        ModuleNotFoundError: No module named #39;cogs#39;(ModuleNotFoundError:沒有名為“cogs的模塊)

        • <i id='UaAyJ'><tr id='UaAyJ'><dt id='UaAyJ'><q id='UaAyJ'><span id='UaAyJ'><b id='UaAyJ'><form id='UaAyJ'><ins id='UaAyJ'></ins><ul id='UaAyJ'></ul><sub id='UaAyJ'></sub></form><legend id='UaAyJ'></legend><bdo id='UaAyJ'><pre id='UaAyJ'><center id='UaAyJ'></center></pre></bdo></b><th id='UaAyJ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='UaAyJ'><tfoot id='UaAyJ'></tfoot><dl id='UaAyJ'><fieldset id='UaAyJ'></fieldset></dl></div>
            <bdo id='UaAyJ'></bdo><ul id='UaAyJ'></ul>

                  <tbody id='UaAyJ'></tbody>

                  <small id='UaAyJ'></small><noframes id='UaAyJ'>

                  <legend id='UaAyJ'><style id='UaAyJ'><dir id='UaAyJ'><q id='UaAyJ'></q></dir></style></legend>
                  <tfoot id='UaAyJ'></tfoot>
                  本文介紹了ModuleNotFoundError:沒有名為“cogs"的模塊的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我編寫了一個使用 cogs 的不和諧機器人.這是我在每個擴展程序/cog 中加載的代碼:

                  I wrote a discord bot that uses cogs. Here's my code for loading in each extension/cog:

                  import discord
                  import os
                  from discord.ext import commands
                  
                  client = commands.Bot(command_prefix= '.')
                  
                  @client.command()
                  async def load(ctx, extension):
                      client.load_extension(f'cogs.{extension}')
                  
                  @client.command()
                  async def unload(ctx, extension):
                      client.unload_extension(f'cogs.{extension}')
                  
                  @client.command()
                  async def reload(ctx, extension):
                      client.unload_extension(f'cogs.{extension}')
                      client.load_extension(f'cogs.{extension}')
                  
                  for filename in os.listdir('.Cogs'):
                      if filename.endswith('.py'):
                          client.load_extension(f'cogs.{filename[:-3]}')
                  
                  client.run('token')
                  

                  我收到以下錯誤:

                  Traceback (most recent call last):
                    File "C:/Users/indap/PycharmProjects/untitled1/venv/Include/Main.py", line 22, in <module>
                      client.load_extension(f'cogs.{filename[:-3]}')
                    File "C:UsersindapAppDataLocalProgramsPythonPython38libsite-packagesdiscordextcommandsot.py", line 649, in load_extension
                      spec = importlib.util.find_spec(name)
                    File "C:UsersindapAppDataLocalProgramsPythonPython38libimportlibutil.py", line 94, in find_spec
                      parent = __import__(parent_name, fromlist=['__path__'])
                  ModuleNotFoundError: No module named 'cogs'
                  

                  我檢查過,文件路徑是正確的,我什至嘗試使用不同的文件路徑,但我仍然得到同樣的錯誤.

                  I've checked, the file path is correct, and I even tried using different file path but I still get the same error.

                  推薦答案

                  看起來可能是區分大小寫的問題.在遍歷目錄的內容時,您已經編寫了 .Cogs 作為路徑,但在 load_extension() 方法中,您已經編寫了 cogs..

                  It looks like it might be a case-sensitive issue. When iterating over the directory's contents, you have written .Cogs as the path, but in the load_extension() method, you have written cogs..

                  嘗試將其更改為 Cogs..要么,要么將目錄本身全部重命名為cogs.

                  Try changing it to Cogs. instead. Either that, or rename the directory itself all lower-case to cogs.

                  這篇關于ModuleNotFoundError:沒有名為“cogs"的模塊的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個在 Python 中提供角色的不和諧機器人?)
                  Discord bot isn#39;t responding to commands(Discord 機器人沒有響應命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關于我嗎?Discord 機器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)
                  <i id='YhPlq'><tr id='YhPlq'><dt id='YhPlq'><q id='YhPlq'><span id='YhPlq'><b id='YhPlq'><form id='YhPlq'><ins id='YhPlq'></ins><ul id='YhPlq'></ul><sub id='YhPlq'></sub></form><legend id='YhPlq'></legend><bdo id='YhPlq'><pre id='YhPlq'><center id='YhPlq'></center></pre></bdo></b><th id='YhPlq'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='YhPlq'><tfoot id='YhPlq'></tfoot><dl id='YhPlq'><fieldset id='YhPlq'></fieldset></dl></div>
                  <tfoot id='YhPlq'></tfoot>
                    <tbody id='YhPlq'></tbody>
                      <bdo id='YhPlq'></bdo><ul id='YhPlq'></ul>

                      1. <legend id='YhPlq'><style id='YhPlq'><dir id='YhPlq'><q id='YhPlq'></q></dir></style></legend>
                          • <small id='YhPlq'></small><noframes id='YhPlq'>

                            主站蜘蛛池模板: 伊人av影院 | a视频在线观看 | 国产精品一区二区不卡 | 国产一区二区久久 | 四虎在线观看视频 | 黄色片免费网站 | 国产精品成人免费精品自在线观看 | 久久久国产精品人人片 | 久久黄色录像 | av手机在线免费观看 | 国产草草| 国产精品尤物 | 欧美一级网站 | 免费一级a毛片 | 成人午夜在线观看 | 国产一区二区免费在线观看 | 99热播| 亚洲成人一区二区 | 日韩精品区 | 日本免费在线观看 | 日本激情网站 | 成人免费在线观看网站 | 国产成人福利 | 九九久久久| 日韩av不卡在线 | 黄色三级在线观看 | 亚洲综合影院 | 久久青青| 免费观看av网站 | 99视频免费观看 | 麻豆一区二区三区 | 日韩一区二区在线播放 | 日韩免费精品 | 93久久精品日日躁夜夜躁欧美 | 亚洲欧美精品 | 人人爽人人爽 | 我要操网站 | 亚洲一区免费观看 | 香蕉视频色版 | 国模一区二区三区 | 四虎影院在线播放 |