久久久久久久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"的模塊的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我編寫了一個使用 cogs 的不和諧機(jī)器人.這是我在每個擴(kuò)展程序/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.

                  推薦答案

                  看起來可能是區(qū)分大小寫的問題.在遍歷目錄的內(nèi)容時,您已經(jīng)編寫了 .Cogs 作為路徑,但在 load_extension() 方法中,您已經(jīng)編寫了 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.

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

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

                  相關(guān)文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個在 Python 中提供角色的不和諧機(jī)器人?)
                  Discord bot isn#39;t responding to commands(Discord 機(jī)器人沒有響應(yīng)命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關(guān)于我嗎?Discord 機(jī)器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機(jī)器人?)
                  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'>

                            主站蜘蛛池模板: 精品一区国产 | 欧美精品91 | 欧产日产国产精品99 | 性色av网站 | 久久久久久久久久久久久91 | 成人a视频片观看免费 | 国产久| 亚洲 欧美 另类 日韩 | 国产九九九九 | 国产精品海角社区在线观看 | 最新中文字幕在线 | 日韩精品在线播放 | 亚洲精品视频免费观看 | 免费激情 | 天天操精品视频 | 久久99国产精一区二区三区 | 99热精品国产 | 亚洲一区二区三区国产 | 91视频一区二区 | 超碰在线久| 免费观看一级毛片视频 | 中文字幕在线第二页 | 日韩国产一区二区三区 | 成人在线观看网站 | 国产一区二区三区色淫影院 | 国产sm主人调教女m视频 | 久久久久久久91 | 欧美性tv| 韩日在线 | 国产一区二区三区亚洲 | 91精品国产综合久久久久久丝袜 | 亚洲国产精品久久 | 干干干操操操 | 精品国产91 | a级在线| 久久久国产精品一区 | 天堂一区在线观看 | 欧美在线视频一区二区 | 久久99深爱久久99精品 | 欧美成人精品激情在线观看 | 亚洲欧美中文日韩在线 |