开发者社区> 问答> 正文

python scrapy 运行爬虫报错?报错

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

展开
收起
爱吃鱼的程序员 2020-06-10 10:43:12 1220 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    求大神,解答。折腾好几天了。就是实在搞不定了。缺包,Linux下装下openssl呗最后一句是重点:借用别人的blog。应该你会明白的。<spanstyle="color:#333333;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px;line-height:25px;background-color:#FFFFFF;">原因是<spanstyle="color:#333333;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px;line-height:25px;background-color:#FF0000;">craptography<spanstyle="color:#333333;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px;line-height:25px;background-color:#FFFFFF;">并没有安装http://my.oschina.net/u/2003106/blog/485890undefinedsymbol:X509_VERIFY_PARAM_set1_ip_asc是变量未定义。但是_openssl.so文件是存在的啊。是什么系统库依赖不对吧?实在找不出问题了。cryptography(1.1.1)这个确实安装过了。

    <spanstyle="font-family:'MicrosoftYaHei',Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;"><spanstyle="font-family:'MicrosoftYaHei',Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">cryptography是不是安装的有问题?

    <spanstyle="font-family:'MicrosoftYaHei',Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">

    <spanstyle="color:#007777;font-family:Verdana,Arial,Helvetica;font-size:small;line-height:normal;background-color:#FFFFFF;">importOpenSSL 

    <spanstyle="line-height:normal;background-color:#FFFFFF;">openssl版本问题:

    <spanstyle="color:#007777;font-family:Verdana,Arial,Helvetica;font-size:small;line-height:normal;background-color:#FFFFFF;"><atarget="_blank"rel="nofollow">http://pypi.python.org/pypi/pyOpenSSL<spanstyle="font-family:Verdana,Arial,Helvetica;font-size:small;line-height:normal;background-color:#FFFFFF;"> 

    <spanstyle="color:#007777;font-family:Verdana,Arial,Helvetica;font-size:small;line-height:normal;background-color:#FFFFFF;">

    回复<aclass='referer'target='_blank'>@liuyzss:尽量用最新的python的模块pyOpenSSL(0.15.1)和OpenSSL1.0.2a19Mar2015不兼容么?

    <imgsrc="http://static.oschina.net/uploads/space/2015/1126/162836_rAPQ_2486541.jpg"alt="">

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

    <imgsrc="http://static.oschina.net/uploads/space/2015/1126/163006_E7zY_2486541.jpg"alt="">

    我有两个名字差不多的

    我的环境是ubuntu14.阿里云服务器。<divclass='ref'>

    引用来自“xper”的评论

    <imgsrc="http://static.oschina.net/uploads/space/2015/1126/163006_E7zY_2486541.jpg"alt="">

    我有两个名字差不多的

    2020-06-10 10:43:29
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Python第五讲——关于爬虫如何做js逆向的思路 立即下载
Python第四讲——使用IPython/Jupyter Notebook与日志服务玩转超大规模数据分析与可视化 立即下载
Improving Python and Spark 立即下载