最新win10下安裝Scrapy 及其環境搭建
說在前面
我的系統目前是win10 64位 scrapy目前只支持到python27
在裝scrapy之前 裝過visual studio community 在MS的官網下載
Scrapy官網有相應的簡單教程
https://scrapy-chs.readthedocs.org/zh_CN/0.24/intro/install.html
注意 不同后綴名安裝方法
a. exe 直接點擊安裝
b.msi 文件 用pip install file_name
c. egg文件 cmd命令行進入到.egg文件所在目錄pip install file_name
d.whl文件 改后綴名為.zip 解壓后 將解壓后的最短文件明拷貝到 python27安裝位置的Lib文件夾里
------具體安裝方法如下 --------
(一) 安裝Python 2.7
(二) Python Package: pip and setuptools.
現在 pip 依賴 setuptools ,如果未安裝,則會自動安裝 setuptools 。
After installing Python, follow these steps before installing Scrapy:
#安裝完Python以后通過以下步驟來安裝 Scrapy:
add the C:python27Scripts and C:python27 folders to the system path by adding those directories to the PATH environment variable from theControl Panel.
#把C:/python27/Scripts 和 C:/python27 添加洗系統環境變量
some binary packages that Scrapy depends on (like Twisted, lxml and pyOpenSSL) require a compiler available to install, and fail if you don’t have Visual Studio installed. You can find Windows installers for those in the following links. Make sure you respect your Python version and Windows architecture.
#Scrapy按照時需要有lxml 和 pyOpenSSL Twisted,如果你沒有安裝 Visual Studio 你可以尋找和你的python版本和系統版本一致的Windows architecture
-------- 搭建 scrapy環境----------------
(三) lxml.
大多數Linux發行版自帶了lxml。如果缺失,請查看 http://lxml.de/installation.html 【python編寫的庫 windows下要安裝】
(四) OpenSSL.
除了Windows(請查看 平臺安裝指南)之外的系統都已經提供。
1. #通過以下步驟來安裝OPENSSL
go to Win32 OpenSSL page #訪問Win32 OpenSSL官網
download OpenSSL for your Windows and architecture (the regular version, not the light one)
#下載安裝OPENSSL在你的系統上
add the c:openssl-win32bin (or similar) directory to your PATH, the same way you added python27 in the first step“ in the first step
#用添加Python環境變量一樣的方法把OPENSSL所在目錄添加到你的系統環境變量里
(五) Twisted 安裝
Twisted 安裝又需要 Zope.Interface ,PyWin32, PyOpenSSL 這三個
http://twistedmatrix.com/trac/wiki/Downloads
所需要的這三個都可以下載 但是 Twisted 點開卻是亂碼,沒辦法下載,我在這個地方找到了 替代鏈接
https://pypi.python.org/packages/2.7/T/Twisted/Twisted-13.0.0.win32-py2.7.msi
----------------------------
(六) Scrapy 安裝
通過以上的步驟你的系統已經具備了安裝Scrapy的環境,接下來通過以下命令開始安裝Scrapy:
pip install Scrapy
安裝完成以后查看scrapy版本Scrapy version
然后Scrapy就可以在windows系統上運行了
截圖留念
參考網站(為主)
https://scrapy-chs.readthedocs.org/zh_CN/0.24/intro/install.html
http://www.shangxueba.com/jingyan/1645080.html
http://blog.csdn.net/androidzhaoxiaogang/article/details/8479140
http://blog.163.com/like_playboy/blog/static/19439238820157221571826/