[問題] 請問用Python3.10安裝requests

作者: adeniss ( )   2021-12-23 18:32:43
不好意思
之前用selenium寫完code後
看到大家有推薦request
想說玩一下
也用pip安裝完了
但是 在import時就發生問題
在import requests時就發生
Exception has occurred: ImportError
cannot import name 'Mapping' from 'collections'
(C:\Python\lib\collections\__init__.py)
collections裡面也的確沒有mapping
試著去pip install collections也沒用
所以上來求救一下
不知道有沒有版友可以幫忙解惑
謝謝
作者: cuteSquirrel (松鼠)   2021-12-23 19:19:00
出錯的那行 把collections 改成 collections.abc
作者: lycantrope (阿寬)   2021-12-23 19:45:00
from typing import Mapping更新requests就可以解決了吧https://github.com/psf/requests/issues/5901

Links booklink

Contact Us: admin [ a t ] ucptt.com