2

I am using CentOS and my default Python version is 2.6. I installed Scrapy using pip install Scrapy and I executed the code below

from scrapy.selector import Selector

And I got this message: Scrapy 0.20.2 requires Python 2.7. I can't just upgrade my current version of Python because I have lots of programs that depends on it. If possible, I would like to install the correct version of Scrapy on my Python 2.6.

kagat-kagat
  • 1,455
  • 4
  • 22
  • 27
  • Don't upgrade, install a brand new one in with [pyenv](https://github.com/yyuu/pyenv) and(or) [virtualenv](http://stackoverflow.com/questions/1534210/use-different-python-version-with-virtualenv) – alko Dec 18 '13 at 07:02
  • I did install a new version 2.7 on my testing machine with virtualenv but didn't work well. It was not able to read the installed Scrapy (for version 2.7) and everything was a mess. If followed this tutorial: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/ – kagat-kagat Dec 18 '13 at 07:11
  • 1
    @kagat-kagat: That'd be a better problem to solve than to mess around with old versions of Scrapy. – Blender Dec 18 '13 at 07:13

2 Answers2

2

Support for Python 2.6 was dropped in version 0.20.0, so just install 0.18.4:

pip install scrapy==0.18.4
Blender
  • 289,723
  • 53
  • 439
  • 496
  • Command "/usr/local/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-DpAvCi/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Avnr9b-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-DpAvCi/cffi – Shahid Karimi Jul 03 '15 at 19:05
  • I always get the above error! Trying to install scrapy for one month. – Shahid Karimi Jul 03 '15 at 19:05
  • @Kannu I got this error either. you need install python-devel package to fix this problem. command is => yum install python-devel ,and in my computer, I got another error: No package 'libffi' found. Finally, I use => "yum install libffi-devel" installed Scapy 0.18.4 successfully. Wish this can help you. – xuanyuanzhiyuan Jul 31 '15 at 03:32
0

easy_install Scrapy==0.18.4 worked for me