安裝Scrapy遇到的問題處理


最近嘗試用Scrapy框架編寫web爬蟲,在安裝過程中遇到一些問題!!!

pip install scrapyl

出現了這樣一個問題:

error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27

字面意義理解,是需要Microsoft Visual C++ 9.0,而我的電腦中已經安裝了Visual Studio 2010了呀。后來在網上查,原來是在windows下使用pip安裝包的時候需要機器裝有vs2008,別的版本還不行。如果不想安裝VS2008,可以安裝Microsoft Visual C++ Compiler for Python 2.7

 

安裝完這個Visual C++的文件后,再次安裝lxml,竟然還是錯誤。不過這次的錯誤和上一次有所區別,錯誤提示內容為:

*********************************************************************************  
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?  
*********************************************************************************

src\lxml\includes\etree_defs.h(14) : fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory  
c:\users\xzfeng\appdata\local\temp\xmlXPathInit0wevj7.c(1) : fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory

幾個錯誤,問題的核心是lxml庫出現了問題,並且確實libxml2庫,在試過多個方案后均不行,最后在將lxml庫的版本進行了降級!!!如下:

#> pip install lxml==3.4.4
Collecting lxml==3.4.4
  Downloading lxml-3.4.4-cp27-none-win32.whl (3.0MB)
    100% |################################| 3.0MB 2.9MB/s
Installing collected packages: lxml
Successfully installed lxml-3.4.4

這樣就成功的安裝的Scrapy!!!!!!!!

 

參考網址:https://bugs.launchpad.net/lxml/+bug/1552818

     http://tianxingzhe.blog.51cto.com/3390077/1726574

     http://blog.csdn.net/xibeichengf/article/details/50479151


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM