[英]Scrapy installation error pip and easy_install
我正在嘗試在 Windows 上安裝 Scrapy,並按照 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')
我也嘗試使用pip但它也不起作用:
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
<class 'socket.error'>: [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
我可以直接從 Internet Explorer 訪問https://pypi.python.org/simple/Scrapy/但不確定為什么 pip 或 easy_install 無法訪問該鏈接。
我正在使用 Anaconda python,所以 easy_install 和 pip 已經是包的一部分。 在安裝pywin32的最后階段,我也遇到了以下錯誤:
在文件對象析構函數中關閉失敗:
sys.excepthook 丟失
丟失的sys.stderr
這是easy_install和pip失敗的原因嗎? 有人可以幫忙嗎?
在 Windows 7 上安裝 scrapy 的分步方法
C:\\Python27\\;C:\\Python27\\Scripts\\;
如果您在添加路徑變量時遇到任何其他問題,請參閱此鏈接
3. 要更新 PATH 在管理模式下打開命令提示符並運行: :\\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編譯器。 你可以從 下載鏈接下載
5.然后安裝scrapy使用的python庫libxml。 您可以通過將命令pip install libxml
寫入命令提示符來下載它。 但是如果您在 pip 安裝中遇到一些問題,您可以根據您的系統架構從http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml下載libxml包。 打開命令提示符進入該下載目錄並pip install NAME_OF_PACKAGE.whl
6. 從下載鏈接安裝 pywin32。 確保下載與您的系統匹配的架構(win32 或 amd64)
7.然后打開命令提示符並運行此命令pip install scrapy
我希望這有助於成功安裝scrapy 8。作為參考使用,您可以通過這些鏈接Scrapy官方頁面和博客了解如何在Windows上安裝scrapy
如何在 Windows 8.1 Pro x64 上的 Python 3.6 上安裝 Scrapy 1.4
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
這就是全部,它應該工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.