python scrapy OpenSSL安装不成功
我是python新手,想尝试做爬虫,初步学习后准备安装scrapy。机器是64位,系统为win7,python是python-2.7.9.amd64.msi。scrapy装的是Scrapy-0.24.5.tar.gz
按照教程需要安装依赖包。其他都安装没有问题,import都能通过,但是安装OpenSSL却始终有问题,一开始提醒说 No module named xxxx,我按照名称去找这些模块下载,但是遇到了 No module named cparser,这个应该是c的东东吧?我下载了以后不知道该怎么办。我想是不是没有装VS2008导致的,就去安装了VS2008。
现在又提醒No module named _cffi_backend,就毫无头绪了。
如果忽略这个错误,直接安装easy_install scrapy也报错(详细在后面)。
继续忽略,我直接输入scrapy startproject tutorial,详细报错在后面,最后一句的意思好像是pkg_resources.py这个包(这个包是装python自己装的)里的一句 raise DistributionNotFound(req)版本有问题?要求cryptography>=0.7?不知道是不是这个意思。但是我现在cryptography的版本号是cryptography-0.8.2.tar.gz啊!
崩溃了,麻烦高手指点!!
openssl安装的是 pyOpenSSL-0.13.1.win-amd64-py2.7.exe
OpenSSL报错详细如下:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "buildbdist.win-amd64eggOpenSSL__init__.py", line 8, in <module>
File "buildbdist.win-amd64eggOpenSSLrand.py", line 11, in <module>
File "buildbdist.win-amd64eggOpenSSL_util.py", line 6, in <module>
File "C:Python27libsite-packagescryptographyhazmatbindingsopensslbindi
ng.py", line 60, in <module>
class Binding(object):
File "C:Python27libsite-packagescryptographyhazmatbindingsopensslbindi
ng.py", line 109, in Binding
libraries=_get_libraries(sys.platform)
File "C:Python27libsite-packagescryptographyhazmatbindingsutils.py", li
ne 97, in build_ffi_for_binding
extra_link_args=extra_link_args,
File "C:Python27libsite-packagescryptographyhazmatbindingsutils.py", li
ne 105, in build_ffi
ffi = FFI()
File "C:Python27libsite-packagescffiapi.py", line 56, in __init__
import _cffi_backend as backend
ImportError: No module named _cffi_backend
scrapy报错如下:
Traceback (most recent call last):
File "C:Python27librunpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:Python27librunpy.py", line 72, in _run_code
exec code in run_globals
File "C:Python27Scriptseasy_install.exe__main__.py", line 5, in <module>
File "C:Python27libsite-packagessetuptools__init__.py", line 11, in <modu
le>
from setuptools.extension import Extension
File "C:Python27libsite-packagessetuptoolsextension.py", line 8, in <modu
le>
from .dist import _get_unpatched
File "C:Python27libsite-packagessetuptoolsdist.py", line 21, in <module>
packaging = pkg_resources.packaging
AttributeError: 'module' object has no attribute 'packaging'
scrapy startproject tutorial报错:
Traceback (most recent call last):
File "C:Python27Scriptsscrapy-script.py", line 5, in <module>
from pkg_resources import load_entry_point
File "C:Python27libsite-packagespkg_resources.py", line 2880, in <module>
working_set = WorkingSet._build_master()
File "C:Python27libsite-packagespkg_resources.py", line 432, in _build_mas
ter
ws.require(__requires__)
File "C:Python27libsite-packagespkg_resources.py", line 741, in require
needed = self.resolve(parse_requirements(requirements))
File "C:Python27libsite-packagespkg_resources.py", line 626, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: cryptography>=0.7
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
推荐使用神箭手云爬虫(http://www.shenjianshou.cn)开发爬虫,不需要安装和配置,编写和运行爬虫都在云上进行,你可以试试~
装activepython试一下?
楼上说的不错,缺依赖
先装cryptography,再装effi,装effi的时候会提示VC++9.0依赖
下载安装这个就好了
https://www.microsoft.com/en-us/download/confirmation.aspx?id=44266
在win上搞这种实验勇气可嘉!
报错基本上都是依赖模块的问题,要么是没安装要么版本不对。还是按照官方文档中的方法安装吧,用pip能自动解决依赖问题。http://doc.scrapy.org/en/latest/intro/install.html