Scrapy是爬虫界大名鼎鼎的存在,在Linux下安装非常顺利,但是在Windows下确实非常多的问题发生,这里记录存在的各类问题以及如何解决。
1. 安装Scrapy失败
直接在windows下安装scrapy大概率会是失败的,主要原因是各类依赖包未必全部安装,故依据具体的问题而定。
>> pip install scrapy
2. openssl
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\Scripts\scrapy-script.py", line 5, in <module>
sys.exit(scrapy.cmdline.execute())
File "C:\ProgramData\Anaconda3\lib\site-packages\scrapy\cmdline.py", line 128, in execute
cmds = _get_commands_dict(settings, inproject)
File "C:\ProgramData\Anaconda3\lib\site-packages\scrapy\cmdline.py", line 46, in _get_commands_dict
cmds = _get_commands_from_module('scrapy.commands', inproject)
File "C:\ProgramData\Anaconda3\lib\site-packages\scrapy\cmdline.py", line 29, in _get_commands_from_module
for cmd in _iter_command_classes(module):
File "C:\ProgramData\Anaconda3\lib\site-packages\scrapy\cmdline.py", line 19, in _iter_command_classes
for module in walk_modules(module_name):
File "C:\ProgramData\Anaconda3\lib\site-packages\scrapy\utils\misc.py", line 71, in walk_modules
submod = import_module(fullpath)
File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\ProgramData\Anaconda3\lib\site-packages\scrapy\commands\version.py", line 6, in <module>
import OpenSSL
File "C:\ProgramData\Anaconda3\lib\site-packages\OpenSSL\__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "C:\ProgramData\Anaconda3\lib\site-packages\OpenSSL\rand.py", line 12, in <module>
from OpenSSL._util import (
File "C:\ProgramData\Anaconda3\lib\site-packages\OpenSSL\_util.py", line 6, in <module>
from cryptography.hazmat.bindings.openssl.binding import Binding
File "C:\ProgramData\Anaconda3\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 12, in <module>
from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: DLL load failed: 操作系统无法运行 %1。
解决办法:
>> pip3 uninstall pyopenssl
>> pip3 uninstall cryptography
>> pip3 install pyopenssl
>> pip3 install cryptography
scrapy在Linux安装非常顺利,但是在Windows上却问题多多,一波三折,个人建议,如果玩开发,还是推荐linux或者mac。
相关文章
- Windows环境下安装pip,方便你的开发
- win10环境下适应pip安装autobahn提示认证失败的问题
- Windows系统下安装MySQL8高版本(已安装MySQL5)
- VS2008下安装与配置DirectShow SDK 9.0 及 DirectShow AMCap改装的问题
- Windows7 上同时安装python3.5和python2.7及遇到一系列问题
- windows32位下安装mongodb
- linux下依赖库的版本问题引起的安装失败:libssl-dev版本问题无法安装 :libssl-dev : 依赖: libssl1.0.0 (= 1.0.1-4ubuntu3) 但是 1.0.1-4ubuntu5.31 正要被安装
- Windows下离线安装Android SDK的简单方法
- 命令行下如何安装VMware Tools并与windows资料共享
- memcache的windows下的安装和简单使用