当我在使用Django一个上传图片功能的时候, Django 提示我安装 Pillow这个图片处理的库, 当我尝试安装的时候. 总是提示安装失败 报如下错误.
v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
-
尝试多次之后,我使用 pip --default-timeout=100 install -U Pillow命令 用于延长timeout的时间
-
然后又报了新的错误
Hash of the package https://pypi.python.org/packages/8d/80/eca7a2d1a3c2dafb960f32f844d570de988e609f5fd17de92e1cf6a01b0a/Pillow-4.0.0.tar.gz#md5=d5af224b0fa2c66dacc9814785fef9e7 (from https://pypi.python.org/simple/pillow/) (f299668af37d7d3ae248fe68ac6e7cfc) doesn't match the expected hash d5af224b0fa2c66dacc9814785fef9e7!
Bad md5 hash for package https://pypi.python.org/packages/8d/80/eca7a2d1a3c2dafb960f32f844d570de988e609f5fd17de92e1cf6a01b0a/Pillow-4.0.0.tar.gz#md5=d5af224b0fa2c66dacc9814785fef9e7 (from https://pypi.python.org/simple/pillow/)
-
查了半天stackOverflow 有人说是因为 下载到一半的Pillow包所影响的. 于是我去site-package 去找下载一半的Pillow 发现并没有找到. 后来有人升级pip It's work for me .
-
输入命令 python -m pip install --upgrade pip
-
再次安装, Successfully installed Pillow-4.0.0 olefile-0.44
****