2014-11-24 129 views
1

使用Windows 7.安裝的Python 3.4.2(以前有2.7.x並在安裝3.4之前卸載)。做了的virtualenv,然後試圖安裝Django和得到一個錯誤:無法在Windows 7上使用Pip安裝Django

(myvenv) C:\Users\user1\djangogirls>pip install Django==1.7.1 
Downloading/unpacking Django==1.7.1 
    Cannot fetch index base URL https://pypi.python.org/simple/ 
    Could not find any downloads that satisfy the requirement Django==1.7.1 
Cleaning up... 
No distributions at all found for Django==1.7.1 
Storing debug log for failure in C:\Users\user1\pip\pip.log 

這裏的日誌和幫助表示讚賞:


C:\Users\user1\djangogirls\myvenv\Scripts\pip run on 11/24/14 13:33:01 Downloading/unpacking Django==1.7.1 Getting page 

https://pypi.python.org/simple/Django/ Could not fetch URL https://pypi.python.org/simple/Django/ : connection error: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/Django/ (Caused by : [Errno 11004] getaddrinfo failed) Will skip URL https://pypi.python.org/simple/Django/ when looking for download links for Django==1.7.1 Getting page https://pypi.python.org/simple/
Could not fetch URL https://pypi.python.org/simple/ : connection error: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/ (Caused by : [Errno 11004] getaddrinfo failed) Will skip URL https://pypi.python.org/simple/ when looking for download links for Django==1.7.1 Cannot fetch index base URL https://pypi.python.org/simple/ URLs to search for versions for Django==1.7.1: * https://pypi.python.org/simple/Django/1.7.1 * https://pypi.python.org/simple/Django/ Getting page https://pypi.python.org/simple/Django/1.7.1 Could not fetch URL https://pypi.python.org/simple/Django/1.7.1 : connection error: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/Django/1.7.1 (Caused by : [Errno 11004] getaddrinfo failed) Will skip URL https://pypi.python.org/simple/Django/1.7.1 when looking for download links for Django==1.7.1 Getting page https://pypi.python.org/simple/Django/ Could not fetch URL https://pypi.python.org/simple/Django/ : connection error: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/Django/ (Caused by : [Errno 11004] getaddrinfo failed) Will skip URL https://pypi.python.org/simple/Django/ when looking for download links for Django==1.7.1 Could not find any downloads that satisfy the requirement Django==1.7.1 Cleaning up... Removing temporary dir C:\Users\user1\djangogirls\myvenv\build... No distributions at all found for Django==1.7.1 Exception information: Traceback (most recent call last): File "C:\Users\user1\djangogirls\myvenv\lib\site-packages\pip\basecommand.py", line 122, in main status = self.run(options, args) File "C:\Users\user1\djangogirls\myvenv\lib\site-packages\pip\commands\install.py", line 278, in run requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File "C:\Users\user1\djangogirls\myvenv\lib\site-packages\pip\req.py", line 1177, in prepare_files url = finder.find_requirement(req_to_install, upgrade=self.upgrade) File "C:\Users\user1\djangogirls\myvenv\lib\site-packages\pip\index.py", line 277, in find_requirement raise DistributionNotFound('No distributions at all found for %s' % req) pip.exceptions.DistributionNotFound: No distributions at all found for Django==1.7.1

+0

,因爲1.7.1是當前版本,只需運行'PIP安裝Django '應該訣竅 – MattDMo 2014-11-24 21:08:39

+0

只有「Django」發生了同樣的事情。 – user1325143 2014-11-24 21:09:05

+0

我關掉了windows防火牆,它安裝好了。我不知道它起初是否是一個緩慢的連接,現在它正好適用,或者防火牆阻止了PIP的某些方面。當我嘗試更多PIP時,會知道更多...不知道我是否應該將此作爲「答案」。 – user1325143 2014-11-24 21:25:35

回答

0

看來,你有點子的連接錯誤。請先檢查您的互聯網連接。如果您的連接是好的,你可以嘗試其他鏡時使用PIP,例如:

pip install -i http://mirrors-url-here/simple Django 

編號:

http://jacobian.org/writing/when-pypi-goes-down/