我无法在我的虚拟环境中安装 Django

时间:2021-03-31 17:27:17

标签: python django pip virtualenv pipenv

我想在我的虚拟环境中安装 Django(完全正常),但是遇到了很多错误。有人知道该怎么做吗?

我刚刚在 PowerShell 中输入:

 pipenv install django

得到这个:

Error:  An error occurred while installing django!
Error text: Collecting django
  Using cached Django-3.1.7-py3-none-any.whl (7.8 MB)

ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM Pipfile.lock!. 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://files.pythonhosted.org/packages/b8/6f/9a4415cc4fe9228e26ea53cf2005961799b2abb8da0411e519fdb74754fa/Django-3.1.7-py3-none-any.whl#sha256=baf099db36ad31f970775d0be5587cc58a6256a6771a44eb795b554d45f211b8 (from -r c:\users\vojtěch\appdata\local\temp\pipenv-e9otm_0m-requirements\pipenv-sj4h6g3_-requirement.txt (line 1)):
        Expected sha256 baf099db36ad31f970775d0be5587cc58a6256a6771a44eb795b554d45f211b8
             Got        764ad5e659cd3a7740b314806b39c67501c6136a21d23652515df3bfb4023d76

1 个答案:

答案 0 :(得分:0)

看起来您的原始下载可能已失败,并且 pip 正在使用缓存下载而不是获取新下载。尝试 pipenv lock --clear,然后再次尝试 pipenv install django