Repository: scrapy/scrapy

Issue:
[Bug] 1.7.1 not support 1.6.0 script
Hello All,

My spider is created by scrapy 1.6.0.
These days, the scrapy updated to 1.7.1, and we found that it cannot support the code build by 1.6.0.

Here is the error:
```
Traceback (most recent call last):
  File "/usr/bin/scrapy", line 6, in <module>
    from scrapy.cmdline import execute
  File "/usr/lib64/python2.7/site-packages/scrapy/cmdline.py", line 10, in <module>
    from scrapy.crawler import CrawlerProcess
  File "/usr/lib64/python2.7/site-packages/scrapy/crawler.py", line 11, in <module>
    from scrapy.core.engine import ExecutionEngine
  File "/usr/lib64/python2.7/site-packages/scrapy/core/engine.py", line 14, in <module>
    from scrapy.core.scraper import Scraper
  File "/usr/lib64/python2.7/site-packages/scrapy/core/scraper.py", line 18, in <module>
    from scrapy.core.spidermw import SpiderMiddlewareManager
  File "/usr/lib64/python2.7/site-packages/scrapy/core/spidermw.py", line 13, in <module>
    from scrapy.utils.conf import build_component_list
  File "/usr/lib64/python2.7/site-packages/scrapy/utils/conf.py", line 4, in <module>
    import configparser
ImportError: No module named configparser
```

Would you please take time to check the issue?

Appreciate for your help in advance.

Thank you.
Installing on CentOS7 (Python 2.7.5)
I've run `pip install scrapy`, but it doesn't seem that this has been installed properly.

Now when I ran `scrapy` on CLI, it ends up in the following message.

```
Traceback (most recent call last):
  File "/usr/bin/scrapy", line 6, in <module>
    from scrapy.cmdline import execute
  File "/usr/lib64/python2.7/site-packages/scrapy/cmdline.py", line 10, in <module>
    from scrapy.crawler import CrawlerProcess
  File "/usr/lib64/python2.7/site-packages/scrapy/crawler.py", line 11, in <module>
    from scrapy.core.engine import ExecutionEngine
  File "/usr/lib64/python2.7/site-packages/scrapy/core/engine.py", line 14, in <module>
    from scrapy.core.scraper import Scraper
  File "/usr/lib64/python2.7/site-packages/scrapy/core/scraper.py", line 18, in <module>
    from scrapy.core.spidermw import SpiderMiddlewareManager
  File "/usr/lib64/python2.7/site-packages/scrapy/core/spidermw.py", line 13, in <module>
    from scrapy.utils.conf import build_component_list
  File "/usr/lib64/python2.7/site-packages/scrapy/utils/conf.py", line 4, in <module>
    import configparser
ImportError: No module named configparser
```

I googled `configparser`, and apparently this used to be called `ConfigParser`.

Has anyone seen this issue?
Any advice will be appreciated.


Discussion:
Hello @Kenith, this has been reported already at #3889 
As I commented there, if you can install additional dependencies you can work around the issue by installing the backported version (https://pypi.org/project/configparser/).
If you don't mind, please consider closing this issue as it is a a duplicate of #3889. Thanks!
addressed by https://github.com/scrapy/scrapy/pull/3887
Hello @Hiroki111, please see my explanation at https://github.com/scrapy/scrapy/pull/3887#issuecomment-513484840.
As a temporary workaround, I believe you should be able to make it work by installing the `configparser` backport (https://pypi.org/project/configparser/)

Resolving patch:
diff --git a/scrapy/utils/conf.py b/scrapy/utils/conf.py
--- a/scrapy/utils/conf.py
+++ b/scrapy/utils/conf.py
@@ -1,10 +1,13 @@
 import os
 import sys
 import numbers
-import configparser
 from operator import itemgetter
 
 import six
+if six.PY2:
+    from ConfigParser import SafeConfigParser as ConfigParser
+else:
+    from configparser import ConfigParser
 
 from scrapy.settings import BaseSettings
 from scrapy.utils.deprecate import update_classpath
@@ -94,7 +97,7 @@ def init_env(project='default', set_syspath=True):
 def get_config(use_closest=True):
     """Get Scrapy config file as a ConfigParser"""
     sources = get_sources(use_closest)
-    cfg = configparser.ConfigParser()
+    cfg = ConfigParser()
     cfg.read(sources)
     return cfg
 


Test patch: