在CentOS 5.8上安装scrapy,关于openssl报错的备忘

如果已经安装python-dev和libxml,在开发环境OS X和ubuntu上安装scrapy非常简单:sudo esay_install scarpy。

但在CentOS5.8上安装碰到了一点小麻烦。


  [root@localhost ~]# easy_install scrapy
  Searching for scrapy
  Best match: Scrapy 0.16.1
  Processing Scrapy-0.16.1-py2.7.egg
  Scrapy 0.16.1 is already the active version in easy-install.pth
  Installing scrapy script to /usr/local/bin

  Using /usr/local/lib/python2.7/site-packages/Scrapy-0.16.1-py2.7.egg
  Processing dependencies for scrapy
  Searching for pyOpenSSL
  ......
  OpenSSL/ssl/connection.c:313: 错误:‘TLSEXT_NAMETYPE_host_name’ 未声明 (在此函数内第一次使用)
  OpenSSL/ssl/connection.c:313: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
  OpenSSL/ssl/connection.c:313: 错误:所在的函数内只报告一次。)
  ......
  error: Setup script exited with error: command 'gcc' failed with exit status 1

看起来是openssl的问题,要升级之,用easy_install,yum之类的安装一遍,不管用,最后没招,直接下源码安装:http://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.12.tar.gz


  [root@localhost ~]# cd pyOpenSSL-0.12
  [root@localhost ~]# python setup.py install
  [root@localhost ~]# easy_install scrapy

搞定。

python scrapy centos openssl
阅读(3800) 评论(0) 2012-11-04
输入类似这样的地址 "name@something.com"
输入类似这样的地址"http://someaddress.com"
验证码 不区分大小写(看不清)