Discord.py Glitch or random error: TypeError: __new__() got an unexpected keyword argument 'deny_new'

后端 未结 5 1795
情歌与酒
情歌与酒 2020-11-30 10:34

Yesterday, my code was perfectly fine. Everything was running... and it was going great. All of a sudden, this error:

TypeError: __new__() got an unexpected k         


        
5条回答
  •  忘掉有多难
    2020-11-30 11:22

    I want to clarify the answer. On a raspberry pi, I somehow had discord.py installed for user pi and for root - and they were different versions in different places. This caused me a lot of confusion; I had no idea I had two copies, and I have no idea how to get down to just 1, which I'd prefer. But the commands that get it working for root are:

    sudo -i
    pip3 uninstall discord.py
    pip3 install discord.py
    python3 -m pip install -U discord.py
    

    Then and only then could I run my discord bot from /etc/rc.local, and for that to work I had to do this in /etc/rc.local:

    (sleep 30; python3 /home/pi/applications/myBot.py &) &
    

    For whatever reason, the usual suggestion of sleep 10 did NOT work, and this is on a pi 4 with not a lot else going on at startup.

提交回复
热议问题