执行抓取任务遭遇配置异常
Closed this issue · 6 comments
gaelthas commented
执行抓取任务遭遇配置异常:a bytes-like object is required, not 'str'
之前可以,最近用了一次突然不行了,请问是为什么呢
jiangshengwu commented
spider/mp3.py
中73-77行:
for music in msg["failed_list"]:
n = music['name'].encode("utf-8")
a = music['artists'][0]['name'].encode("utf-8")
i = music['id']
tb.append([n, a, i])
改为
for music in msg["failed_list"]:
n = music['name']
a = music['artists'][0]['name']
i = music['id']
tb.append([n, a, i])
gaelthas commented
@jiangshengwu 能否请教一下,改了之后python setup.py install 就可以了吗
chengyumeng commented
请问是什么版本的Python
gaelthas commented
python 2.7.15
python 3.6.5
chengyumeng commented
你确认下你运行时的环境,不可能是两个。
gaelthas commented
因为我不知道调用的是哪个,所以把两个版本号都发出来了,很抱歉。在命令行默认是2.7.15的