python scrapy 运行爬虫报错

liuyzss 发布于 2015/11/25 23:12
阅读 2K+
收藏 0

ubuntu14安装python,scrapy。项目运行报错,求大神指点。感谢。

Traceback (most recent call last):
  File "/usr/local/bin/scrapy", line 11, in <module>
    sys.exit(execute())
  File "/usr/local/lib/python2.7/dist-packages/scrapy/cmdline.py", line 143, in execute
    _run_print_help(parser, _run_command, cmd, args, opts)
  File "/usr/local/lib/python2.7/dist-packages/scrapy/cmdline.py", line 89, in _run_print_help
    func(*a, **kw)
  File "/usr/local/lib/python2.7/dist-packages/scrapy/cmdline.py", line 150, in _run_command
    cmd.run(args, opts)
  File "/usr/local/lib/python2.7/dist-packages/scrapy/commands/crawl.py", line 57, in run
    self.crawler_process.crawl(spname, **opts.spargs)
  File "/usr/local/lib/python2.7/dist-packages/scrapy/crawler.py", line 150, in crawl
    crawler = self._create_crawler(crawler_or_spidercls)
  File "/usr/local/lib/python2.7/dist-packages/scrapy/crawler.py", line 166, in _create_crawler
    return Crawler(spidercls, self.settings)
  File "/usr/local/lib/python2.7/dist-packages/scrapy/crawler.py", line 46, in __init__
    self.extensions = ExtensionManager.from_crawler(self)
  File "/usr/local/lib/python2.7/dist-packages/scrapy/middleware.py", line 56, in from_crawler
    return cls.from_settings(crawler.settings, crawler)
  File "/usr/local/lib/python2.7/dist-packages/scrapy/middleware.py", line 32, in from_settings
    mwcls = load_object(clspath)
  File "/usr/local/lib/python2.7/dist-packages/scrapy/utils/misc.py", line 44, in load_object
    mod = import_module(module)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/local/lib/python2.7/dist-packages/scrapy/extensions/memusage.py", line 16, in <module>
    from scrapy.mail import MailSender
  File "/usr/local/lib/python2.7/dist-packages/scrapy/mail.py", line 22, in <module>
    from twisted.internet import defer, reactor, ssl
  File "/usr/local/lib/python2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/internet/ssl.py", line 59, in <module>
    from OpenSSL import SSL
  File "/usr/local/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/usr/local/lib/python2.7/dist-packages/OpenSSL/rand.py", line 11, in <module>
    from OpenSSL._util import (
  File "/usr/local/lib/python2.7/dist-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 13, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: /usr/local/lib/python2.7/dist-packages/cryptography/hazmat/bindings/_openssl.so: undefined symbol: X509_VERIFY_PARAM_set1_ip_asc

加载中
0
liuyzss
liuyzss
求大神,解答。折腾好几天了。就是实在搞不定了。
0
路小磊
路小磊
缺包,Linux下装下openssl呗
0
xper
xper
最后一句是重点:借用别人的blog。应该你会明白的。原因是craptography并没有安装http://my.oschina.net/u/2003106/blog/485890
liuyzss
liuyzss
undefined symbol: X509_VERIFY_PARAM_set1_ip_asc是变量未定义。但是_openssl.so文件是存在的啊。是什么系统库依赖不对吧?实在找不出问题了。
liuyzss
liuyzss
cryptography (1.1.1)这个确实安装过了。
0
铂金胖子
铂金胖子

cryptography 是不是安装的有问题?

0
红叔
红叔

import OpenSSL 

openssl版本问题:

http://pypi.python.org/pypi/pyOpenSSL 


红叔
红叔
回复 @liuyzss : 尽量用最新的
liuyzss
liuyzss
python的模块pyOpenSSL (0.15.1)和OpenSSL 1.0.2a 19 Mar 2015不兼容么?
0
xper
xper

我的目录结构你看下,有没有问题

0
xper
xper

我有两个名字差不多的

liuyzss
liuyzss
我的环境是ubuntu14.阿里云服务器。
0
liuyzss
liuyzss

引用来自“xper”的评论

我有两个名字差不多的

返回顶部
顶部