windows 安装django 报错

报错信息如下:

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError ('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000015EC9DBCD68>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed')': /simple/virtualenv/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError ('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000015EC9DBC630>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed')': /simple/virtualenv/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError ('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000015EC9DBC6D8>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed')': /simple/virtualenv/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError ('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000015EC9DBC668>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed')': /simple/virtualenv/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError ('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000015EC9DBC0B8>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed')': /simple/virtualenv/ ERROR: Could not find a version that satisfies the requirement virtualenv (from versions: none) ERROR: No matching distribution found for virtualenv

 

 

【解决】

1.

通过镜像安装django 如:pip install django==1.9.8 -i https://pypi.tuna.tsinghua.edu.cn/simple

 

2.

通过镜像安装virtualenv 如:pip install virtualenv -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

 

3.

所以推荐使用virtualenvwrapper:通过镜像安装 如:pip install virtualenvwrapper-win -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

 

4.

创建完成后,使用mkvirtualenv testvir2 自动进入虚拟环境 通过workon 来查看当前有哪些虚拟环境;进入虚拟环境 workon +虚拟环境

posted @ 2020-01-12 18:13  yanhuidj  阅读(709)  评论(0编辑  收藏  举报