Discord.py: discord.utils has no attribute ‘format_dt’

So the title says it all. I’ve also tried updating Discord.py with the following code:

import discord, os, discord.ext
import discord_components as dcomponents
from discord_components import DiscordComponents, Button, Select, SelectOption
from discord.ext import commands
def vcheck():
  if discord.__version__ != "2.0.0a":
      printf('DISCORD UPDATE DETECTED. Installing...', 'red')
      result, ver = [], discord.__version__;
      result.append(os.system('pip install --upgrade pip'))
      result.append(os.system('pip install -U git+https://github.com/Rapptz/discord.py'))
      printf('Succesfully installed version {}! Old version: {}.nInstall results: {}'.format(discord.__version__, ver, result), 'green')
      del ver
    except (BaseException, Exception) as exc:
      printf(repr(exc), 'red')
  if discord.__version__ != "2.0.0a": vcheck();
vcheck() # loops indefinitely and it won't run until Discord's version is 2.0.0a.

When vcheck() is called, it would loop indefinitely and it wouldn’t run until Discord’s version is 2.0.0a. (It does not either update at all). Any fix for this?

Is this question duplicated? No. I have reviewed that there are no questions with this exact title.


Yeah, it looks like the problem is an old version of discord.py

I’d recommend first not using actual Python code to update it. If you can, try using the command line tool pip to update. Here are a few methods you can try.

Upgrading using pip

Run pip install --upgrade discord and pip install --upgrade discord.py


Run pip uninstall discord and pip uninstall discord.py

Those commands uninstall discord.py

Then run pip install discord and pip install discord.py

These steps will reinstall discord.py.

Using the command line version of pip will probably work better than installing using code. Please tell me whether or not this works.

Note: discord.py is going to be deprecated, so you may want to find another library to make a Discord bot.