2014-06-30 84 views
2

我想在Windows上安裝Scrapy,並遵循Scrapy安裝指南中的步驟來安裝所有的依賴項。但是,我得到了以下錯誤消息,當我試圖用easy_install的Scrapy安裝錯誤點和easy_install

Download error on https://pypi.python.org/simple/Scrapy/ : [Errno 10061] No connection could be made because the target machine actively refused it -- Some packages may not be found! Couldn't find index page for 'Scrapy' (maybe misspelled?)

Scanning index of all packages (this may take a while) Reading https://pypi.python.org/simple/ Download error on https://pypi.python.org/simple/ : [Errno 10061] No connection could be made because the target machine actively refused it -- Some packages may not be found! No local packages or download links found for Scrapy error: Could not find suitable distribution for Requirement.parse('Scrapy')

我還試圖用點子,但它無法正常工作或:

Downloading/unpacking Scrapy Cannot fetch index base URL https://pypi.python.org/simple/ Could not find any downloads that satisfy the requirement Scrapy Cleaning up... No distributions at all found for Scrapy

我去pip.log它說

Could not fetch URL https://pypi.python.org/simple/Scrapy/ : connection error: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/Scrapy/ (Caused by : [Errno 10061] No connection could be made because the target machine actively refused it) Will skip URL https://pypi.python.org/simple/Scrapy/ when looking for download links for Scrapy

我可以訪問https://pypi.python.org/simple/Scrapy/直接從互聯網expl但不知道爲什麼pip或easy_install無法訪問鏈接。

我正在使用Anaconda python,因此easy_install和pip已經是包的一部分。我也有以下錯誤安裝在pywin32的最後階段:

close failed in file object destructor:

sys.excepthook is missing

lost sys.stderr

這是easy_install的原因和PIP失敗了嗎?任何人都可以幫忙嗎?

感謝

+0

可能的[在Windows 7上安裝Scrapy-Python和Easy \ _install]的重複(https://stackoverflow.com/questions/28150433/installing-scrapy-python-and-easy-install-on-windows-7) –

回答

0

一步一步的方式,在Windows 7

  1. 安裝scrapy從Python Download link安裝Python 2.7(一定要安裝Python 2.7,只是因爲目前scrapy不適用於Python3在Windows中)
  2. 在pyhton安裝過程中,可以使用複選框將python路徑添加到系統變量中,然後單擊該選項。否則,您可以手動添加路徑變量。 您需要調整PATH環境變量以包含Python可執行文件和其他腳本的路徑。 以下路徑需要如果在添加路徑變量請參見本link
    3.更新路徑打開管理模式命令提示符任何其他問題,要添加到PATH C:\Python27\;C:\Python27\Scripts\; windows add path variable

運行::\python27\python.exe c:\python27\tools\scripts\win_add2path.py。關閉命令提示符窗口並重新打開它,以使更改生效,運行以下命令,檢查添加到路徑變量的事情。
python -–version這將給輸出Python 2.7.12(您的版本可能比我的不同)
pip --version,這將給作爲pip 9.0.1輸出(您的版本可能比我的不同)
4.您需要安裝Visual Basic C++ Python的編譯器。你可以從Download link
下載那個5.然後你安裝libxml來安裝scrapy使用的python庫。您可以通過在命令提示符下編寫命令pip install libxml來下載它。 但是如果您在安裝pip時遇到一些問題,您可以從http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml下載下載它libxml根據您的系統架構打包。打開命令提示符進入該下載目錄並pip install NAME_OF_PACKAGE.whl
6.從Download link安裝pywin32。 確保您下載符合您的系統
7.然後打開命令提示符架構(win32的或AMD64),並運行此命令pip install scrapy
我希望這將在成功安裝scrapy 8.幫助僅供參考使用您可以這些鏈接Scrapy official PageBlog on how to install scrapy on windows

0

如何在Windows 8.1上的Python 3.6安裝Scrapy 1.4專業版64位

pip install virtualenv 
pip install virtualenvwrapper 
pip install virtualenvwrapper-win 
mkvirtualenv my_scrapy_project 

我建議使用virtualenv。在我的示例中,我爲我的虛擬環境使用名稱my_scrapy_project。 如果你想出去的virtualenv,簡單地輸入停用,如果你想回去到,只需鍵入workon my_scrapy_project

pip install lxml-4.1.1-cp36-cp36m-win32.whl

pip install scrapy 

,這是所有,它應該工作。