Problem importing yarl or discord.py on python3.6

Viewed 1702

I recently updated discord.py due to an error outlined in this post and after updating it I can no longer import it.

Running import discord brings up the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/discord/__init__.py", line 23, in <module>
    from .client import Client
  File "/usr/local/lib/python3.6/site-packages/discord/client.py", line 34, in <module>
    import aiohttp
  File "/usr/local/lib/python3.6/site-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import BaseConnector as BaseConnector
  File "/usr/local/lib/python3.6/site-packages/aiohttp/client.py", line 30, in <module>
    from yarl import URL
  File "/usr/local/lib/python3.6/site-packages/yarl/__init__.py", line 1, in <module>
    from ._url import URL, cache_clear, cache_configure, cache_info
  File "/usr/local/lib/python3.6/site-packages/yarl/_url.py", line 56, in <module>
    @rewrite_module
  File "/usr/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'

The last thing on the list was yarl, so I tried an import yarl and got this error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/yarl/__init__.py", line 1, in <module>
    from ._url import URL, cache_clear, cache_configure, cache_info
  File "/usr/local/lib/python3.6/site-packages/yarl/_url.py", line 56, in <module>
    @rewrite_module
  File "/usr/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'

The version of python is 3.6.8. I've also tried this on a different machine with 3.6.9 and got the same error. I've tried this on a machine with 3.7.7 and everything loaded normally, but I do not have the ability to upgrade python to 3.7 on this machine and so would like to get it to work on 3.6.

2 Answers

Upgrading pip did not help me.

Forcing the reinstall of yarl as shown by @Orangutan did not help me.

However, the following did the trick:

mkdir ~/backup
mv ~/.local/lib/python3.6/site-packages/yarl* ~/backup/
pip3 install yarl --force-reinstall --no-cache-dir
Related