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