基于pip install django失败时的解决方法

yipeiwu_com6年前Python基础

使用pip安装Django时报错,先是:

C:\Users\admin>pip install django 
Collecting django 
 Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out. (read timeout=15)",)': /simple/django/ 
 Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', timeout('_ssl.c:733: The handshake operation timed out',))': /simple/django/ 
 Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', timeout('timed out',))': /simple/django/ 

之后开始下载后没多少就直接报错退出了,可以用下面的方法换源下载:

pip install -i https://pypi.douban.com/simple django 

下载速度很快,成功!

以上这篇基于pip install django失败时的解决方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持【听图阁-专注于Python设计】。

相关文章

PyQt5实现从主窗口打开子窗口的方法

PyQt5实现从主窗口打开子窗口的方法

1.在Qt Designer中设计两个简单窗口 2.将.ui文件转换成.py文件 3.新建**.py文件 #-*- coding:utf-8 -*- from PyQt5.QtWi...

Python:slice与indices的用法

slice:   eg:     >>>e=[0,1,2,3,4,5,6]     >>>s=slice(2,3)     >>&...

python 远程统计文件代码分享

python 远程统计文件 #!/usr/bin/python #encoding=utf-8 import time import os import paramiko impor...

python实现的用于搜索文件并进行内容替换的类实例

本文实例讲述了python实现的用于搜索文件并进行内容替换的类。分享给大家供大家参考。具体实现方法如下: #!/usr/bin/python -O # coding: UTF-8 "...

Python 最大概率法进行汉语切分的方法

要求: 1 采用基于语言模型的最大概率法进行汉语切分。 2 切分算法中的语言模型可以采用n-gram语言模型,要求n >1,并至少采用一种平滑方法; 代码: 废话不说,代码是最好的...