ModuleNotFoundError: No module named ‘fake_useragent‘
文章目录
一、现象
直接输入pip install fake_useragent
看似下载了,却依然会报ModuleNotFoundError: No module named ‘fake_useragent‘的错误
或者就不来虚的,直接报错
二、解决方法
注:以下四种解决方法并不会冲突,可以都试一波
1、继续运行pip install fake_useragent
再尝试一波
2、运行pip版本号+ install fake_useragent
a、获取python版本
输入:python
获取python的版本
b、下载fake_useragent
由于我的python版本是3.8s所以输入:
pip3.8 install fake_useragent
3、运行pip install -U fake_useragent
下载无符号版
4、利用whl安装fake_useragent
fake-useragent官网:https://pypi.org/project/fake-useragent/#files
下载最新的 fake-useragent 包,
查看下载路径:
然后 在cmd ,直接cd 到tar 包的目录,用命令安装:pip install ./fake-useragent-0.1.11.tar.gz
提示安装成功!
三、当以上方法都不行时的绝招
再次运行一波正经的下载,试图下载fake_useragent
pip install fake_useragent -i https://pypi.tuna.tsinghua.edu.cn/simple/
可能会有惊喜