Discord.py: TypeError: __init__() got an unexpected keyword argument 'requote'

Created on 27 Jul 2020  路  7Comments  路  Source: Rapptz/discord.py

Summary

Even after updating discord.py, I still get an error trying to run my bot

Reproduction Steps

I have no idea, I just reinstalled discord.py as recommended and still got errors

Expected Results

The bot to run.

Actual Results

This may be caused by another library, but i dont know.

Traceback (most recent call last):
  File "bot.py", line 2, in <module>
    import discord
  File "/home/linefins/.local/lib/python3.6/site-packages/discord/__init__.py", line 23, in <module>
    from .client import Client
  File "/home/linefins/.local/lib/python3.6/site-packages/discord/client.py", line 34, in <module>
    import aiohttp
  File "/home/linefins/.local/lib/python3.6/site-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import BaseConnector as BaseConnector
  File "/home/linefins/.local/lib/python3.6/site-packages/aiohttp/client.py", line 30, in <module>
    from yarl import URL
  File "/home/linefins/.local/lib/python3.6/site-packages/yarl/__init__.py", line 1, in <module>
    from ._url import URL, cache_clear, cache_configure, cache_info
  File "/home/linefins/.local/lib/python3.6/site-packages/yarl/_url.py", line 56, in <module>
    @rewrite_module
  File "/home/linefins/.local/lib/python3.6/site-packages/yarl/_url.py", line 132, in URL
    _QUERY_PART_QUOTER = _Quoter(safe="?/:@", qs=True, requote=False)
  File "yarl/_quoting.pyx", line 192, in yarl._quoting._Quoter.__init__
TypeError: __init__() got an unexpected keyword argument 'requote'

Checklist

  • [ ] I have searched the open issues for duplicates.
  • [x] I have shown the entire traceback, if possible.
  • [x] I have removed my token from display, if visible.

System Information

For some reason, the command given also breaks when I attempt to run it.

Python: 3.6.9
discord.py version: 1.3.4
OS: Ubuntu 18.04.4 LTS

dep bug

Most helpful comment

MY BOY'S ALIVE

Logged in as
Brewbot

All 7 comments

Reinstall yarl by pinning it to version 1.4.2; pip install -U yarl==1.4.2

From what I can gather this is an issue where you have a cached binary dependency and it's causing a conflict in the installation. You can fix it either by downgrading or by forcing a re-install using pip install yarl --force-reinstall --no-cache-dir. You're right though that this is caused by a dependency and not by discord.py directly.

okie thank :)

MY BOY'S ALIVE

Logged in as
Brewbot

@Rapptz @XuaTheGrate The stated solutions don't seem to work, running pip3 install -U yarl==1.4.2 results in the code saying No module named discord.py, then reinstalling discord.py makes the original problem come back. Also when installing yarl with the above command at the end it says Successfully installed idna-2.10 multidict-4.7.6 yarl-1.5.1
so I don't think the version setting worked?

No module named discord.py

The module you are meant to import is discord not discord.py

Also when installing yarl with the above command at the end it says Successfully installed idna-2.10 multidict-4.7.6 yarl-1.5.1

Make sure to specify the version yarl==1.4.2. Last I checked, the latest version 1.5.1 still has this bug so you need to downgrade to 1.4.2.

Ok thanks, it works now!
I did put yarl==1.4.2 at the end of the command though, strange...

Was this page helpful?
0 / 5 - 0 ratings