close

1.TypeError: a bytes-like object is required, not 'str'
socket傳送的是二進制編碼

要送出去的話後面要.encode()

二進制編碼轉回我們平常要看的東西的話要用的是.decode()

有其他編碼問題再調整這樣

2.python3 中的reload(sys)

import sys
reload(sys)
sys.setdefaultencoding(‘utf-8’)
以上是python2的寫法,但是在python3中這個需要已經不存在了,這麽做也不會什麽實際意義。
在Python2.x中由於str和byte之間沒有明顯區別,經常要依賴於defaultencoding來做轉換。
在python3中有了明確的str和byte類型區別,從一種類型轉換成另一種類型要顯式指定encoding。

但是仍然可以使用這個方法代替
import importlib,sys
importlib.reload(sys)

3.ImportError: No module named dotenv

pip install python-dotenv

4.Python3 Discord Module No Attribute Client

Your program is called discord.py. That is masking the real discord module. Call the program something else.

 


arrow
arrow
    創作者介紹
    創作者 低階ㄇㄋ 的頭像
    低階ㄇㄋ

    蟲匯聚之所

    低階ㄇㄋ 發表在 痞客邦 留言(0) 人氣()