0%

即使“Requirement Already satisfied in Pip”也找不到Python模块

❓ 我用pip安装了几个软件包,但出现ImportError: no module named requests。运行pip安装请求时:

1
2
3
4
5
6
> sudo -H pip install requests 
Requirement already satisfied: requests in /usr/local/lib/python2.7/site-packages
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python2.7/site-packages (from requests)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python2.7/site-packages (from requests)
Requirement already satisfied: urllib3<1.22,>=1.21.1 in /usr/local/lib/python2.7/site-packages (from requests)
Requirement already satisfied: idna<2.6,>=2.5 in /usr/local/lib/python2.7/site-packages (from requests)

它在twindb_cloudflare, requests, group, tarutil,和MySQL DB上出错。 我可以在另一个脚本(在同一文件夹中)上运行完全相同的导入而不会出现错误。


✔️ 在命令提示符下运行

1
pip list

如果您使用的是旧版本,请检查系统上已安装的版本
尝试卸载软件包

1
pip uninstall requests

重新安装

1
pip install requests

您还可以测试pip是否不起作用

1
easy_install requests