我使用的是 Windows,当我想要安装软件包时,出现以下错误:
pip install django
Requirement already satisfied (use --upgrade to upgrade): django in c:\python27\lib\site-packages
C:\code\Djangotest\amar-e-simples-master>pip install django --upgrade
Collecting django
Downloading Django-1.9.7-py2.py3-none-any.whl (6.6MB)
6% |# | 399kB 3.3MB/s eta 0:00:02
THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
django from https://pypi.python.org/packages/e6/f9/154e1460c4a95c90ab28ead50314161ea2c4016f3561033b41f687f0a76d/Django-1.9.7-py2.py3-none-any.whl#md5=5224b6f237a9e46a84fc0f9921f678ae:
Expected md5 5224b6f237a9e46a84fc0f9921f678ae
Got f603e16057383b3ad12d8bda84492fbb
Run Code Online (Sandbox Code Playgroud)
如何解决这个问题(在 Windows 中)?
如果您收到类似 pip: error: no such option: --hash 的错误,则您使用的 Pip 版本太旧,请使用以下命令进行升级:
\n\n$ pip install --升级 pip\n\n
在 Windows 上,推荐的命令是:
\n\npython -m pip install --升级 pip\n\n
更新后,如果再次出现此错误,\n请在升级/安装时使用“ --no-cache-dir ”:
\n\npip --no-cache-dir install YOUR-PACKAGENAME\n\n
或者
\n\npip --no-cache-dir install --upgrade YOUR-PACKAGENAME\n\n
哈希值不同的一个很好的原因是,如果您使用的平台未被现有哈希值覆盖的具有轮子的包。
\n