About the error "AttributeError: module 'resource' has no attribute 'getrusage'"

Under the windows platform, when scrapy1.8.0 runs, an "AttributeError: module 'resource' has no attribute 'getrusage'" error message will appear. Find File ".. \ python37 \ lib \ site-packages \ scrapy \ extensions \ memusage.py" , There are already clear notes:

        try:
            # stdlib's resource module is only available on unix platforms.
            self.resource = import_module('resource')
        except ImportError:
            raise NotConfigured

(Unix only, optional) The  resource module is used to query or modify the current system resource limit settings, indicating that this module is not available in windows, which causes this error. The crawler can't modify the system resources and can run as usual. Wait for patching!

Published 150 original articles · praised 149 · 810,000 views

Guess you like

Origin blog.csdn.net/chaishen10000/article/details/103282909