在做一个上传文件的功能,urllib不太好用,换到requests,但需要安装这个模块,pip install之后却报错:

import requests

ModuleNotFoundError: No module named 'requests'

 

看到之前的安装日志,发现是装在默认的2.7版本下。

多个python版本,在安装模块的时候,要指定版本,使用下面这个命令就OK了:
sudo python3 -m pip install requests

相关文章:

  • 2021-12-07
  • 2021-10-31
  • 2021-07-21
  • 2021-07-29
  • 2021-06-18
  • 2022-01-27
  • 2021-07-04
猜你喜欢
  • 2021-06-26
  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
  • 2021-10-22
  • 2022-12-23
相关资源
相似解决方案