久久久久久久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'>

                            主站蜘蛛池模板: 国产高清精品一区二区三区 | 午夜精品一区 | 午夜精品久久久久久久久久久久 | 在线欧美一区 | 日本不卡一区 | 日本久久综合 | 成人av免费播放 | 久久精品国产a三级三级三级 | 国产一区二区中文字幕 | 北条麻妃国产九九九精品小说 | 国产综合在线视频 | 国产精品久久久久久久久久久久午夜片 | 亚洲欧美日韩一区 | 国产成人精品免费视频 | www.日韩| 久久亚洲欧美日韩精品专区 | 久久国产精品精品国产色婷婷 | 黄色一级片视频 | 日韩亚洲视频在线 | 爱爱免费视频 | 三级黄视频在线观看 | 国产伦精品一区二区三区视频金莲 | 日韩av在线一区 | www.中文字幕.com | 日韩久草| 国产日韩欧美一区 | 精品视频一区二区三区 | 天天插日日操 | 一级毛片免费视频观看 | 精品国产欧美在线 | 日韩一区二区三区四区五区 | 亚洲国产精品99久久久久久久久 | 香蕉视频一区二区 | 国产精品欧美一区二区三区不卡 | 日韩一区二区三区av | 性色av网站 | 日韩在线视频免费观看 | 欧美一级久久 | 亚洲国产成人在线 | 久久久久中文字幕 | 玖玖在线免费视频 |