我正在尝试在virtualenv中安装Django包.我在一台新电脑上(OSX 10.8.2).我通过easy_install安装了virtualenv.随着virtualenv的激活,我跑了:
(pyenv)$ pip install Django
Downloading/unpacking Django
Downloading Django-1.5.1.tar.gz (8.0MB): 2.0MB downloaded
Hash of the package https://pypi.python.org/packages/source/D/Django/Django-1.5.1.tar.gz#md5=7465f6383264ba167a9a031d6b058bff (from https://pypi.python.org/simple/Django/) (<md5 HASH object @ 0x108453df0>) doesn't match the expected hash 7465f6383264ba167a9a031d6b058bff!
Bad md5 hash for package https://pypi.python.org/packages/source/D/Django/Django-1.5.1.tar.gz#md5=7465f6383264ba167a9a031d6b058bff (from https://pypi.python.org/simple/Django/)
Run Code Online (Sandbox Code Playgroud)
即使我删除了virtualenv并重新开始,也会发生这种情况.在过去的几个小时里,我再次尝试过,它总会发生.有什么建议?
我有 Django 2.2.7,现在我想安装 Django 3.0.2。我读到我需要运行命令pip install -U Django来更新它,但是当我尝试时它显示此错误消息
ERROR: 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://files.pythonhosted.org/packages/55/d1/8ade70e65fa157e1903fe4078305ca53b6819ab212d9fbbe5755afc8ea2e/Django-3.0.2-py3-none-any.whl#sha256=4f2c913303be4f874015993420bf0bd8fd2097a9c88e6b49c6a92f9bdd3fb13a:
Expected sha256 4f2c913303be4f874015993420bf0bd8fd2097a9c88e6b49c6a92f9bdd3fb13a
Got f97dfd0d593c3c78e81ca2f4fd095a21cd0a30752e7b8754294bf1d42541a218
Run Code Online (Sandbox Code Playgroud)
我应该怎么办?
这是我的requeriments.txt
argon2-cffi==19.2.0
asgiref==3.2.3
cffi==1.13.2
Django==3.0.2
django-environ==0.4.5
djangorestframework==3.11.0
Pillow==7.0.0
psycopg2-binary==2.8.4
pycparser==2.19
pytz==2019.3
six==1.14.0
sqlparse==0.3.0
Run Code Online (Sandbox Code Playgroud) 我使用的是 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 中)?