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 +虚拟环境


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM