Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: __init__() got an unexpected keyword argument 'requote' #5162

Closed
2 of 3 tasks
blurengo opened this issue Jul 27, 2020 · 8 comments
Closed
2 of 3 tasks

TypeError: __init__() got an unexpected keyword argument 'requote' #5162

blurengo opened this issue Jul 27, 2020 · 8 comments
Labels
dep bug A bug with the dependencies

Comments

@blurengo
Copy link

blurengo commented Jul 27, 2020

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.
  • I have shown the entire traceback, if possible.
  • 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

@XuaTheGrate
Copy link
Contributor

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

@Rapptz Rapptz added the dep bug A bug with the dependencies label Jul 27, 2020
@Rapptz
Copy link
Owner

Rapptz commented Jul 27, 2020

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.

@Rapptz Rapptz closed this as completed Jul 27, 2020
@blurengo
Copy link
Author

okie thank :)

@blurengo
Copy link
Author

MY BOY'S ALIVE

Logged in as
Brewbot

@Liftyee
Copy link

Liftyee commented Aug 12, 2020

@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?

@Phxntxm
Copy link
Contributor

Phxntxm commented Aug 12, 2020

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.

@Liftyee
Copy link

Liftyee commented Aug 13, 2020

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

@Harmon758
Copy link
Contributor

Harmon758 commented Nov 22, 2020

This was due to an issue with yarl v1.5.0's MANIFEST.in and was fixed in v1.5.1 of yarl.
However, as far as I'm aware, there have been no successful methods of reproducing the issue.

It's possible that force reinstalling v1.5.0 even without using the cache can fail. I think it's plausible that this is because there are files that are mistakenly no longer associated with the library by pip that will not be uninstalled during the reinstall. This means that it's also possible that upgrading from v1.5.0 to v1.5.1 will not fix the issue (see also aio-libs/aiohttp#4880 (comment)), since those files will not be uninstalled during the upgrade process either.

Since yarl v1.4.2's MANIFEST.in is correct, downgrading to yarl v1.4.2 fixes the issue.
Additionally, there should be no issue with upgrading to a version of yarl > 1.5.0 (e.g. v1.5.1) afterwards, since the incorrect MANIFEST.in in v1.5.0 would be skipped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dep bug A bug with the dependencies
Projects
None yet
Development

No branches or pull requests

6 participants