Python安裝Scrapy出現以下錯誤怎麼辦?
Command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools, tokenize;__file__="/private/var/folders/v_/8q5wz8sd2tq63n5lcvp5hzwr0000gn/T/pip_build_CraxDc/lxml/setup.py";exec(compile(getattr(tokenize, "open", open)(__file__).read().replace("
", "
"), __file__, "exec"))" install --record /var/folders/v_/8q5wz8sd2tq63n5lcvp5hzwr0000gn/T/pip-bhsYSw-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/v_/8q5wz8sd2tq63n5lcvp5hzwr0000gn/T/pip_build_CraxDc/lxmlStoring debug log for failure in /Users/CraxDc/.pip/pip.log
使用的是 pip install scrapy這個命令
使用easy_install scrapy的話會出現
1 error generated.
error: Setup script exited with error: command "/usr/bin/clang" failed with exit status 1
http://my.oschina.net/xtfjt1988/blog/364577
安裝Scrapy需要的依賴基本都在裡面。
我安裝時候出了個問題,win32py 那一步報錯。後來去python - Error installing and running pywin32 2.7跟著網友說的輸入了指令「python scriptspywin32_postinstall.py -install」,成功安裝後,Scrapy也就沒問題了。
報錯基本都是缺東西,依賴都安完以後應該就沒問題了先安裝wheel 再下載 Twisted模塊的.whl安裝包Python Extension Packages for WindowsPython Extension Packages for Windows 再pip install scrapy 就能安裝成功了
windows的話把以下文件都安裝了就行:
http://sourceforge.NET/projects/pywin32/files/pywin32/Build%20219/
https://launchpad.Net/pyopenssl/+download
Microsoft Visual C++ Compiler for Python 2.7
Python Package Index
Python3環境安裝Scrapy爬蟲框架過程及常見錯誤 - 琉璃塊 - 博客園
在網上找到的解決辦法,希望可以幫到有同樣問題的人
用sudo pip install scrapy 試試
推薦閱讀: