eliangcs/pystock-crawler

ScrapyDeprecationWarning: Module `scrapy.log` has been deprecated

Opened this issue · 6 comments

ubgpu@ubgpu:/github/pystock-crawler$
ubgpu@ubgpu:
/github/pystock-crawler$ PYTHONPATH=/usr/local/lib/python2.7/dist-packages pystock-crawler prices GOOG,YHOO -o out.csv --sort
/usr/local/bin/pystock-crawler:33: ScrapyDeprecationWarning: Module scrapy.log has been deprecated, Scrapy now relies on the builtin Python library for logging. Read the updated logging entry in the documentation to learn more.
from scrapy import log
Traceback (most recent call last):
File "/usr/local/bin/pystock-crawler", line 267, in
main()
File "/usr/local/bin/pystock-crawler", line 252, in main
log.start(logfile=log_file)
AttributeError: 'module' object has no attribute 'start'
ubgpu@ubgpu:/github/pystock-crawler$
ubgpu@ubgpu:
/github/pystock-crawler$ sudo pip2 install scrapy
Requirement already satisfied (use --upgrade to upgrade): scrapy in /usr/local/lib/python2.7/dist-packages
Cleaning up...
ubgpu@ubgpu:~/github/pystock-crawler$

What's your Scrapy version? You can use pip freeze to check.

wired~~

ubgpu@ubgpu:/github$ sudo pip2 install scrapy
[sudo] password for ubgpu:
Requirement already satisfied (use --upgrade to upgrade): scrapy in /usr/local/lib/python2.7/dist-packages
Cleaning up...
ubgpu@ubgpu:
/github$ pip2 freeze | grep scrapy
ubgpu@ubgpu:~/github$

Hello, cool project.

I know that this is an old (but open?) issue, but I get the same error on Scrapy==1.3.0, on a Ubuntu 16.04.1 LTS when I run the first of your examples.

(scraping) milia@Newton:pystocks$ pystock-crawler prices GOOG,YHOO -o out.csv /home/milia/.venvs/scraping/bin/pystock-crawler:33: ScrapyDeprecationWarning: Module scrapy.log has been deprecated, Scrapy now relies on the builtin Python library for logging. Read the updated logging entry in the documentation to learn more.
from scrapy import log
Traceback (most recent call last):
File "/home/milia/.venvs/scraping/bin/pystock-crawler", line 267, in <module>
main()
File "/home/milia/.venvs/scraping/bin/pystock-crawler", line 252, in main
log.start(logfile=log_file)
AttributeError: 'module' object has no attribute 'start'

Installation of scrapy and pystock-crawler went just fine inside a new virtualenv.

Any thoughts or pointers are welcome !

@mlliarm this project uses Scrapy 0.24.4. Can you reinstall Scrapy old version and try again?

@eliangcs Thanks, I'll do that right now and let you know.
EDIT: It works just fine now !

scrapy.log has been deprecated alongside its functions in favor of explicit calls to the Python standard logging. Keep reading to learn more about the new logging system ,the url is https://doc.scrapy.org/en/latest/topics/logging.html